linux/drivers/usb/core
Niklas Neronin f89fef7710 usb: config: fix iteration issue in 'usb_get_bos_descriptor()'
[ Upstream commit 974bba5c11 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-08 08:51:17 +01:00
..
buffer.c
config.c usb: config: fix iteration issue in 'usb_get_bos_descriptor()' 2023-12-08 08:51:17 +01:00
devices.c
devio.c
driver.c
endpoint.c
file.c
generic.c
hcd-pci.c
hcd.c
hub.c usb: hub: Guard against accesses to uninitialized BOS descriptors 2023-10-19 23:08:55 +02:00
hub.h usb: hub: Guard against accesses to uninitialized BOS descriptors 2023-10-19 23:08:55 +02:00
Kconfig
ledtrig-usbport.c
Makefile
message.c
notify.c
of.c
otg_productlist.h
phy.c
phy.h
port.c
quirks.c
sysfs.c
urb.c
usb-acpi.c
usb.c
usb.h