linux/drivers/usb/serial
Zhang Cen 9f9bfc80c6 USB: serial: cypress_m8: validate interrupt packet headers
cypress_read_int_callback() parses the interrupt-in buffer according to
the selected Cypress packet format. Format 1 has a two-byte status/count
header and format 2 has a one-byte combined status/count header. The
usb-serial core sizes the interrupt-in buffer from the endpoint
descriptor's wMaxPacketSize, and successful interrupt transfers can
complete short when URB_SHORT_NOT_OK is not set.

Check that the completed packet contains the selected header before
reading it. Malformed short reports are ignored and the interrupt URB is
resubmitted through the existing retry path, preventing out-of-bounds
header-byte reads.

KASAN report as below:
KASAN slab-out-of-bounds in cypress_read_int_callback+0x240/0x7f0
Read of size 1
Call trace:
  cypress_read_int_callback() (drivers/usb/serial/cypress_m8.c:1009)
  __usb_hcd_giveback_urb()
  dummy_timer()

Fixes: 3416eaa1f8 ("USB: cypress_m8: Packet format is separate from characteristic size")
Assisted-by: Codex:gpt-5.5
Signed-off-by: Zhang Cen <rollkingzzc@gmail.com>
Fixes: 3416eaa1f8 ("USB: cypress_m8: Packet format is separate from characteristic size")
Cc: stable@vger.kernel.org	# 2.6.26
[ johan: use constants in header length sanity checks ]
Signed-off-by: Johan Hovold <johan@kernel.org>
History 2026-05-23 09:35:26 +02:00
..
aircable.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ark3116.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
belkin_sa.c USB: serial: belkin_sa: validate interrupt status length 2026-05-20 16:22:46 +02:00
belkin_sa.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
bus.c USB: serial: bus: fix const issue in usb_serial_device_match() 2025-05-21 17:01:37 +02:00
ch341.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
console.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cp210x.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cyberjack.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cypress_m8.c USB: serial: cypress_m8: validate interrupt packet headers 2026-05-23 09:35:26 +02:00
cypress_m8.h USB: serial: cypress_m8: enable Simply Automated UPB PIM 2020-06-23 09:56:17 +02:00
digi_acceleport.c USB: serial: digi_acceleport: fix memory corruption with small endpoints 2026-05-20 16:26:22 +02:00
empeg.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
ezusb_convert.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
f81232.c USB: serial: f81232: fix incomplete serial port generation 2026-01-13 15:59:07 +01:00
f81534.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
ftdi_sio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ftdi_sio.h USB: serial: ftdi_sio: rename channel index 2022-09-15 08:05:53 +02:00
ftdi_sio_ids.h USB: serial: ftdi_sio: add support for PICAXE AXE027 cable 2026-01-13 14:08:46 +01:00
garmin_gps.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
generic.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
io_16654.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
io_edgeport.c USB: serial: io_edgeport: add support for Blackbox IC135A 2026-03-17 15:28:14 +01:00
io_edgeport.h USB: serial: io_edgeport: drop unused definitions 2021-04-08 09:50:04 +02:00
io_ionsp.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
io_ti.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
io_ti.h USB: serial: io_ti: drop unnecessary packed attributes 2021-04-13 18:23:34 +02:00
io_usbvend.h USB: serial: io_edgeport: add support for Blackbox IC135A 2026-03-17 15:28:14 +01:00
ipaq.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
ipw.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ir-usb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
iuu_phoenix.c USB: serial: iuu_phoenix: fix iuutool author name 2026-04-08 09:37:43 +02:00
iuu_phoenix.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
Kconfig USB: serial: simple: add Nokia phone driver 2022-03-03 09:27:36 +01:00
keyspan.c USB: serial: keyspan: fix missing indat transfer sanity check 2026-05-20 16:26:48 +02:00
keyspan_pda.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
keyspan_usa26msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
keyspan_usa28msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
keyspan_usa49msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
keyspan_usa67msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
keyspan_usa90msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
kl5kusb105.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
kl5kusb105.h USB: serial: kl5kusb105: remove KLSI device id 2018-07-11 10:11:29 +02:00
kobil_sct.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
kobil_sct.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile USB: serial: add MaxLinear/Exar USB to Serial driver 2021-01-21 10:49:37 +01:00
Makefile-keyspan_pda_fw USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
mct_u232.c USB: serial: mct_u232: fix missing interrupt-in transfer sanity check 2026-05-20 16:27:10 +02:00
mct_u232.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
metro-usb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mos7720.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mos7840.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
mxuport.c USB: serial: mxuport: fix memory corruption with small endpoint 2026-05-23 09:07:18 +02:00
navman.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
omninet.c USB: serial: omninet: fix memory corruption with small endpoint 2026-05-23 09:07:30 +02:00
opticon.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
option.c USB: serial: option: add missing RSVD(5) flag for Rolling RW135R-GL 2026-05-21 09:53:59 +02:00
oti6858.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
oti6858.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
pl2303.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pl2303.h USB: serial: pl2303: add device id for Macrosilicon MS3020 2024-09-06 17:11:13 +02:00
qcaux.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
qcserial.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
quatech2.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
safe_serial.c USB: serial: safe_serial: fix memory corruption with small endpoint 2026-05-23 09:07:36 +02:00
sierra.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
spcp8x5.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ssu100.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
symbolserial.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ti_usb_3410_5052.c USB: serial: ti_usb_3410_5052: use strscpy() instead of strcpy() 2026-03-17 15:35:07 +01:00
upd78f0730.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
usb-serial-simple.c USB: serial: simple: add OWON HDS200 series oscilloscope support 2025-04-16 08:38:22 +02:00
usb-serial.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
usb-wwan.h USB: serial: make usb_serial_driver::chars_in_buffer return uint 2021-05-19 10:56:41 +02:00
usb_debug.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
usb_wwan.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
visor.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
visor.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
whiteheat.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
whiteheat.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
wishbone-serial.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00
xr_serial.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xsens_mt.c USB: serial: drop driver owner initialization 2024-08-26 15:28:25 +02:00