mirror-linux/drivers/net/can/usb
Greg Kroah-Hartman 38a01c9700 can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of a message
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 <mailhol@kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: stable@kernel.org
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <mkl@pengutronix.de>
2026-03-02 11:03:42 +01:00
..
etas_es58x can: etas_es58x: allow partial RX URB allocation to succeed 2026-01-09 10:30:23 +01:00
kvaser_usb Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
peak_usb Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig can: Add Nuvoton NCT6694 CANFD support 2025-09-16 14:41:57 +01:00
Makefile can: Add Nuvoton NCT6694 CANFD support 2025-09-16 14:41:57 +01:00
ems_usb.c can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of a message 2026-03-02 11:03:42 +01:00
esd_usb.c can: esd_usb: add endpoint type validation 2026-03-02 11:03:32 +01:00
f81604.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gs_usb.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mcba_usb.c can: mcba_usb: mcba_usb_read_bulk_callback(): fix URB memory leak 2026-01-16 20:40:46 +01:00
nct6694_canfd.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ucan.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
usb_8dev.c can: usb_8dev: usb_8dev_read_bulk_callback(): fix URB memory leak 2026-01-16 20:40:52 +01:00