mirror-linux/drivers/usb
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
..
atm
c67x00
cdns3 usb: cdnsp: Fix deadlock issue during using NCM gadget 2023-12-03 07:32:12 +01:00
chipidea usb: chipidea: Simplify Tegra DMA alignment code 2023-11-20 11:52:10 +01:00
class USB: usbtmc: Fix direction for 0-length ioctl control messages 2023-05-24 17:32:48 +01:00
common usb: common: usb-conn-gpio: Prevent bailing out if initial role is none 2023-08-16 18:27:24 +02:00
core usb: config: fix iteration issue in 'usb_get_bos_descriptor()' 2023-12-08 08:51:17 +01:00
dwc2 USB: dwc2: write HCINT with INTMASK applied 2023-12-03 07:32:12 +01:00
dwc3 USB: dwc3: qcom: fix wakeup after probe deferral 2023-12-03 07:32:13 +01:00
early usb: early: xhci-dbc: Fix a potential out-of-bound memory access 2023-03-10 09:33:35 +01:00
gadget usb: gadget: f_ncm: Always set current gadget in ncm_bind() 2023-11-28 17:07:01 +00:00
host USB: xhci-plat: fix legacy PHY double init 2023-12-08 08:51:17 +01:00
image
isp1760
misc usb: misc: onboard_hub: add support for Microchip USB2412 USB 2.0 hub 2023-10-25 12:03:08 +02:00
mon
mtu3 usb: mtu3: fix kernel panic at qmu transfer done irq handler 2023-05-11 23:03:30 +09:00
musb usb: musb: Modify the "HWVers" register address 2023-10-19 23:08:55 +02:00
phy usb: phy: mxs: fix getting wrong state with mxs_phy_is_otg_host() 2023-09-13 09:42:51 +02:00
renesas_usbhs
roles Revert "usb: common: usb-conn-gpio: Set last role to unknown before initial detection" 2023-07-19 16:21:56 +02:00
serial USB: serial: option: don't claim interface 4 for ZTE MF290 2023-12-03 07:32:12 +01:00
storage usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility 2023-11-08 14:11:03 +01:00
typec usb: typec: tcpm: Skip hard reset when in error recovery 2023-12-03 07:32:12 +01:00
usbip USB: usbip: fix stub_dev hub disconnect 2023-11-20 11:52:10 +01:00
Kconfig
Makefile
usb-skeleton.c