]> git.ipfire.org Git - thirdparty/linux.git/commit
can: ems_usb: validate CPC message lengths
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Mon, 6 Jul 2026 09:27:52 +0000 (17:27 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 29 Jul 2026 10:00:18 +0000 (12:00 +0200)
commit02925f51377f2a42a6724f00549167499c9302e5
tree9b2d8bf78732242d27714ee8af259d42250fc4a2
parent7a0cf2b2497c757c3cb1286eddf2986abb0d387b
can: ems_usb: validate CPC message lengths

ems_usb_read_bulk_callback() walks CPC messages packed in one USB
receive buffer.

Check that each declared message fits in the URB payload. Also require the
type-specific payload to cover the fields used by the CAN, state, error and
overrun handlers.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260706092752.79600-1-pengpeng@iscas.ac.cn
Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface")
Cc: stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/ems_usb.c