linux/drivers/usb/core
Seungjin Bae 50fde089fb USB: Fix descriptor count when handling invalid MBIM extended descriptor
[ Upstream commit 5570ad1423 ]

In cdc_parse_cdc_header(), the check for the USB_CDC_MBIM_EXTENDED_TYPE
descriptor was using 'break' upon detecting an invalid length.

This was incorrect because 'break' only exits the switch statement,
causing the code to fall through to cnt++, thus incorrectly
incrementing the count of parsed descriptors for a descriptor that was
actually invalid and being discarded.

This patch changes 'break' to 'goto next_desc;' to ensure that the
logic skips the counter increment and correctly proceeds to the next
descriptor in the buffer. This maintains an accurate count of only
the successfully parsed descriptors.

Fixes: e4c6fb7794 ("usbnet: move the CDC parser into USB core")
Signed-off-by: Seungjin Bae <eeodqql09@gmail.com>
Link: https://lore.kernel.org/r/20250928185611.764589-1-eeodqql09@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-01-19 13:09:22 +01:00
..
buffer.c usb: usbfs: Enforce page requirements for mmap 2023-06-14 11:13:07 +02:00
config.c usb: core: config: Prevent OOB read in SS endpoint companion parsing 2025-08-28 16:24:26 +02:00
devices.c usb: common: add function to get interval expressed in us unit 2021-03-10 09:37:17 +01:00
devio.c usb: hide unused usbfs_notify_suspend/resume functions 2023-07-23 13:47:23 +02:00
driver.c USB: core: rename usb_driver_claim_interface() data parameter 2021-03-23 12:39:39 +01:00
endpoint.c usb: common: add function to get interval expressed in us unit 2021-03-10 09:37:17 +01:00
file.c USB: core: Fix races in character device registration and deregistraion 2019-08-12 22:47:24 +02:00
generic.c usbcore: Check both id_table and match() when both available 2020-10-28 13:24:58 +01:00
hcd-pci.c USB: hcd-pci: Fully suspend across freeze/thaw cycle 2022-06-14 18:36:21 +02:00
hcd.c usb: core: hcd: fix accessing unmapped memory in SINGLE_STEP_SET_FEATURE test 2025-08-28 16:24:35 +02:00
hub.c usb: hub: Don't try to recover devices lost during warm reset. 2025-08-28 16:24:31 +02:00
hub.h usb: hub: Fix flushing of delayed work used for post resume purposes 2025-08-28 16:24:02 +02:00
Kconfig USB: hub: Add Kconfig option to reduce number of port initialization retries 2020-10-02 11:29:02 +02:00
ledtrig-usbport.c usb: core: ledtrig-usbport: Demote obvious misuse of kerneldoc to standard comment blocks 2020-07-09 16:46:57 +02:00
Makefile usb: core: add a wrapper for the USB PHYs on the HCD 2018-03-09 09:43:53 -08:00
message.c USB: Fix descriptor count when handling invalid MBIM extended descriptor 2026-01-19 13:09:22 +01:00
notify.c USB: core: Remove usbfs_mutex 2019-06-26 10:28:09 +08:00
of.c drivers: usb: Fix trivial spelling 2020-06-18 10:13:16 +02:00
otg_productlist.h USB: OTG: rename product list of devices 2020-06-19 08:58:55 +02:00
phy.c usb: core: phy: add support for PHY calibration 2019-09-03 15:54:55 +02:00
phy.h usb: core: phy: add support for PHY calibration 2019-09-03 15:54:55 +02:00
port.c USB: core: Disable LPM only for non-suspended ports 2025-01-23 17:15:54 +01:00
quirks.c usb/core/quirks: Add Huawei ME906S to wakeup quirk 2025-10-29 14:03:12 +01:00
sysfs.c usb: core: sysfs: Unmerge @usb3_hardware_lpm_attr_group in remove_power_attributes() 2024-09-04 13:23:41 +02:00
urb.c usb: core: usb_submit_urb: downgrade type check 2025-08-28 16:24:19 +02:00
usb-acpi.c usb: acpi: add helper to check port lpm capability using acpi _DSM 2023-01-24 07:22:44 +01:00
usb.c usb: Add checks for snprintf() calls in usb_alloc_dev() 2025-07-10 15:57:34 +02:00
usb.h USB: core: Change usb_get_device_descriptor() API 2023-09-19 12:22:53 +02:00