mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
mei: vsc: Fix packet CRC computed over pointer size
vsc_tp_xfer() computes the packet CRC over sizeof(pkt) + olen bytes,
but pkt is a pointer, so sizeof(pkt) evaluates to the pointer size
instead of the size of struct vsc_tp_packet_hdr. The value correctly
match the 8-byte header on 64-bit builds.
Use sizeof(pkt->hdr), consistent with the header size used everywhere
else in the driver, e.g. in VSC_TP_PACKET_SIZE().
Cc: stable@kernel.org
Fixes: 566f5ca976 ("mei: Add transport driver for IVSC device")
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Link: https://patch.msgid.link/20261006-vcs_fix_crc-v1-1-b7b149f13c1d@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2b23952d70
commit
1d2a50533a
|
|
@ -293,7 +293,7 @@ int vsc_tp_xfer(struct vsc_tp *tp, u8 cmd, const void *obuf, size_t olen,
|
|||
pkt->hdr.seq = cpu_to_le32(++tp->seq);
|
||||
memcpy(pkt->buf, obuf, olen);
|
||||
|
||||
crc = ~crc32(~0, (u8 *)pkt, sizeof(pkt) + olen);
|
||||
crc = ~crc32(~0, (u8 *)pkt, sizeof(pkt->hdr) + olen);
|
||||
memcpy(pkt->buf + olen, &crc, sizeof(crc));
|
||||
|
||||
ret = vsc_tp_wakeup_request(tp);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user