mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
When looking at the data in a USB urb, the actual_length is the size of
the buffer passed to the driver, not the transfer_buffer_length which is
set by the driver as the max size of the buffer.
When parsing the messages in ems_usb_read_bulk_callback() properly check
the size both at the beginning of parsing the message to make sure it is
big enough for the expected structure, and at the end of the message to
make sure we don't overflow past the end of the buffer for the next
message.
Cc: Vincent Mailhol <[email protected]>
Cc: Marc Kleine-Budde <[email protected]>
Cc: [email protected]
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Link: https://patch.msgid.link/2026022316-answering-strainer-a5db@gregkh
Fixes: 702171adee ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface")
Signed-off-by: Marc Kleine-Budde <[email protected]>