linux/drivers/usb
Amit Sunil Dhamne 6ffa219f90 usb: typec: tcpm/tcpci_maxim: Fix bounds check in process_rx()
commit 0736299d09 upstream.

Register read of TCPC_RX_BYTE_CNT returns the total size consisting of:

  PD message (pending read) size + 1 Byte for Frame Type (SOP*)

This is validated against the max PD message (`struct pd_message`) size
without accounting for the extra byte for the frame type. Note that the
struct pd_message does not contain a field for the frame_type. This
results in false negatives when the "PD message (pending read)" is equal
to the max PD message size.

Fixes: 6f413b559f ("usb: typec: tcpci_maxim: Chip level TCPC driver")
Signed-off-by: Amit Sunil Dhamne <amitsd@google.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Kyle Tso <kyletso@google.com>
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/stable/20250502-b4-new-fix-pd-rx-count-v1-1-e5711ed09b3d%40google.com
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250502-b4-new-fix-pd-rx-count-v1-1-e5711ed09b3d@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-06-27 11:07:25 +01:00
..
atm usb: atm: cxacru: fix a flaw in existing endpoint checks 2025-03-13 12:53:20 +01:00
c67x00 USB: c67x00: remove unnecessary check of res 2022-05-12 11:36:46 +02:00
cdns3 usb: cdnsp: Fix issue with detecting USB 3.2 speed 2025-06-27 11:07:25 +01:00
chipidea usb: chipidea: ci_hdrc_imx: implement usb_phy_init() error handling 2025-05-02 07:46:59 +02:00
class usb: usbtmc: Fix read_stb function and get_stb ioctl 2025-06-27 11:07:24 +01:00
common usb: ulpi: Fix debugfs directory leak 2024-02-23 09:12:34 +01:00
core usb: Flush altsetting 0 endpoints before reinitializating them after reset. 2025-06-27 11:07:25 +01:00
dwc2 usb: dwc2: gadget: remove of_node reference upon udc_stop 2025-02-21 13:50:02 +01:00
dwc3 usb: dwc3: gadget: Avoid using reserved endpoints on Intel Merrifield 2025-05-02 07:47:02 +02:00
early usb: early: xhci-dbc: Fix a potential out-of-bound memory access 2023-03-10 09:33:35 +01:00
gadget HID: usbhid: Eliminate recurrent out-of-bounds bug in usbhid_parse() 2025-06-27 11:07:24 +01:00
host usb: host: tegra: Prevent host controller crash when OTG port is used 2025-05-18 08:21:24 +02:00
image usb/image: fix repeated words in comments 2022-07-27 14:33:53 +02:00
isp1760 usb: isp1760: Fix out-of-bounds array access 2022-05-19 18:10:59 +02:00
misc USB: chaoskey: Fix possible deadlock chaoskey_list_lock 2024-12-14 19:53:53 +01:00
mon usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-01-25 15:27:40 -08:00
mtu3 usb: mtu3: fix kernel panic at qmu transfer done irq handler 2023-05-11 23:03:30 +09:00
musb usb: musb: Fix hardware lockup on first Rx endpoint request 2024-12-14 19:54:05 +01:00
phy usb: phy: Fix API devm_usb_put_phy() can not release the phy 2024-11-08 16:26:44 +01:00
renesas_usbhs usb: renesas_usbhs: Reorder clock handling and power management in probe 2025-06-27 11:07:16 +01:00
roles usb: roles: set switch registered flag early on 2025-02-21 13:50:01 +01:00
serial USB: serial: pl2303: add new chip PL2303GC-Q20 and PL2303GT-2AB 2025-06-27 11:07:05 +01:00
storage usb: storage: Ignore UAS driver for SanDisk 3.2 Gen2 storage device 2025-06-27 11:07:05 +01:00
typec usb: typec: tcpm/tcpci_maxim: Fix bounds check in process_rx() 2025-06-27 11:07:25 +01:00
usbip usbip: Don't submit special requests twice 2024-09-08 07:53:10 +02:00
Kconfig usb: remove reference to deleted config STB03xxx 2021-08-18 15:32:19 +02:00
Makefile USB: xen-hcd: Traverse host/ when CONFIG_USB_XEN_HCD is selected 2024-06-21 14:35:43 +02:00
usb-skeleton.c usb: usb-skeleton: Update min() to min_t() 2021-10-05 12:56:48 +02:00