linux/drivers/usb
Johan Hovold 7a6f22d747 USB: ldusb: fix read info leaks
Fix broken read implementation, which could be used to trigger slab info
leaks.

The driver failed to check if the custom ring buffer was still empty
when waking up after having waited for more data. This would happen on
every interrupt-in completion, even if no data had been added to the
ring buffer (e.g. on disconnect events).

Due to missing sanity checks and uninitialised (kmalloced) ring-buffer
entries, this meant that huge slab info leaks could easily be triggered.

Note that the empty-buffer check after wakeup is enough to fix the info
leak on disconnect, but let's clear the buffer on allocation and add a
sanity check to read() to prevent further leaks.

Fixes: 2824bd250f ("[PATCH] USB: add ldusb driver")
Cc: stable <stable@vger.kernel.org>     # 2.6.13
Reported-by: syzbot+6fe95b826644f7f12b0b@syzkaller.appspotmail.com
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191018151955.25135-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-18 11:56:22 -07:00
..
atm USB: atm: cxacru: convert to use dev_groups 2019-08-09 07:55:45 +02:00
c67x00
cdns3 usb: cdns3: Fix dequeue implementation. 2019-10-15 20:07:44 +02:00
chipidea Add role switch class support for chipidea 2019-09-05 10:02:07 +02:00
class USB: usblp: fix use-after-free on disconnect 2019-10-15 20:19:19 +02:00
common usb: common: add USB GPIO based connection detection driver 2019-09-03 19:01:04 +02:00
core LED updates for 5.4-rc1 2019-09-17 18:40:42 -07:00
dwc2 USB: Changes for v5.4 merge window 2019-09-02 19:20:57 +02:00
dwc3 usb: dwc3: Remove dev_err() on platform_get_irq() failure 2019-10-07 12:52:44 +02:00
early drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
gadget usb: udc: lpc32xx: fix bad bit shift operation 2019-10-15 20:07:44 +02:00
host xhci-ext-caps.c: Add missing platform_device_put() on error in xhci_create_intel_xhci_sw_pdev() 2019-10-04 14:37:53 +02:00
image USB: microtek: fix info-leak at probe 2019-10-04 11:02:58 +02:00
isp1760 usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
misc USB: ldusb: fix read info leaks 2019-10-18 11:56:22 -07:00
mon docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
mtu3 usb: mtu3: register a USB Role Switch for dual role mode 2019-09-03 20:02:15 +02:00
musb usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
phy USB: Changes for v5.4 merge window 2019-09-02 19:20:57 +02:00
renesas_usbhs usb: renesas_usbhs: gadget: Fix usb_ep_set_{halt,wedge}() behavior 2019-10-04 14:36:22 +02:00
roles USB changes for 5.4-rc1 2019-09-18 10:33:46 -07:00
serial USB: serial: ti_usb_3410_5052: clean up serial data access 2019-10-16 10:29:23 +02:00
storage Modules updates for v5.4 2019-09-22 10:34:46 -07:00
typec usb: typec: ucsi: displayport: Fix for the mode entering routine 2019-10-04 13:51:26 +02:00
usbip usbip: vhci_hcd indicate failed message 2019-10-04 11:02:59 +02:00
Kconfig usb: common: create Kconfig file 2019-09-03 19:00:39 +02:00
Makefile USB: Changes for v5.4 merge window 2019-09-02 19:20:57 +02:00
usb-skeleton.c USB: usb-skeleton: drop redundant in-urb check 2019-10-10 12:41:19 +02:00