u-boot/drivers/usb
Sean Anderson 24057fe0a8 sandbox: usb: Fix out-of-bounds read when fd=-1
sandbox_flash_bulk uses priv->read_len to determine if priv->buff contains
the response data (such as from SCSI_INQUIRY). However, if priv->fd=-1 in
handle_read, then priv->read_len is not set even though we are going to
PHASE_DATA. This causes sandbox_flash_bulk to try and read len bytes from
priv->buff, which likely goes past the end of the buffer. Fix this by always
setting priv->read_len even if we aren't going to read anything.

Fixes: f4f715360c ("dm: usb: sandbox: Add an emulator for USB flash devices")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-28 03:09:51 +01:00
..
cdns3 usb: cdns3: cdns3-ti: Add compatible for AM64 SoC 2021-11-17 17:09:47 -05:00
common usb: xhci-dwc3: Support role switch default role 2022-05-20 09:41:33 +02:00
dwc3 usb: dwc3: Fix non-usb3 configurations 2022-05-20 23:30:36 +02:00
emul sandbox: usb: Fix out-of-bounds read when fd=-1 2022-06-28 03:09:51 +01:00
eth Add support for TP-Link UE200 dongle 2022-04-22 10:35:14 +02:00
gadget stm32mp1: fix reference for STMicroelectronics 2022-06-17 14:12:27 +02:00
host usb: host: ehci-generic: Make resets and clocks optional 2022-06-16 15:22:55 -04:00
mtu3 usb: mtu3: flush cache for the first GPD when allocate GPD ring 2021-11-03 08:47:57 +01:00
musb drivers/usb/musb/musb_udc.c: Fix spelling of "mismatch". 2022-01-13 07:57:49 -05:00
musb-new doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
phy usb: phy: ti: Remove non-DM PHY code 2021-09-27 21:38:34 -04:00
ulpi common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
Kconfig usb: Enforce DM_USB migration for USB_HOST devices. 2021-07-18 21:05:31 -04:00