linux-stable/drivers/usb/core
Niklas Neronin 974bba5c11 usb: config: fix iteration issue in 'usb_get_bos_descriptor()'
The BOS descriptor defines a root descriptor and is the base descriptor for
accessing a family of related descriptors.

Function 'usb_get_bos_descriptor()' encounters an iteration issue when
skipping the 'USB_DT_DEVICE_CAPABILITY' descriptor type. This results in
the same descriptor being read repeatedly.

To address this issue, a 'goto' statement is introduced to ensure that the
pointer and the amount read is updated correctly. This ensures that the
function iterates to the next descriptor instead of reading the same
descriptor repeatedly.

Cc: stable@vger.kernel.org
Fixes: 3dd550a2d3 ("USB: usbcore: Fix slab-out-of-bounds bug during device reset")
Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20231115121325.471454-1-niklas.neronin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-21 15:30:56 +01:00
..
buffer.c - Yosry Ahmed brought back some cgroup v1 stats in OOM logs. 2023-06-28 10:28:11 -07:00
config.c usb: config: fix iteration issue in 'usb_get_bos_descriptor()' 2023-11-21 15:30:56 +01:00
devices.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
devio.c usb: convert to new timestamp accessors 2023-10-18 13:26:17 +02:00
driver.c USB: mark all struct bus_type as const 2023-03-23 13:22:00 +01:00
endpoint.c
file.c USB: make usb class a const structure 2023-07-25 17:49:30 +02:00
generic.c usb: core: Fix file path that does not exist 2021-12-05 14:24:19 +01:00
hcd-pci.c usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk 2023-10-02 16:19:12 +02:00
hcd.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
hub.c Revert "usb: phy: add usb phy notify port status API" 2023-11-06 14:47:36 +01:00
hub.h usb: Inform the USB Type-C class about enumerated devices 2023-10-16 20:02:36 +02:00
Kconfig
ledtrig-usbport.c usb: core: Use module_led_trigger macro to simplify the code 2023-08-22 14:44:23 +02:00
Makefile usb: misc: Add onboard_usb_hub driver 2022-07-08 14:53:50 +02:00
message.c USB: core: Change usb_get_device_descriptor() API 2023-08-08 10:45:32 +02:00
notify.c
of.c usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
otg_productlist.h
phy.c
phy.h
port.c usb: core: Remove duplicated check in usb_hub_create_port_device 2023-10-21 12:53:55 +02:00
quirks.c USB: quirks: add quirk for Focusrite Scarlett 2023-07-25 17:41:22 +02:00
sysfs.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
urb.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
usb-acpi.c usb: acpi: Switch to use acpi_evaluate_dsm_typed() 2023-03-16 12:15:10 +01:00
usb.c USB: core: Fix unused variable warning in usb_alloc_dev() 2023-08-12 10:03:37 +02:00
usb.h USB: core: Change usb_get_device_descriptor() API 2023-08-08 10:45:32 +02:00