linux-stable/drivers/usb
Oliver Neukum 1426bd2c9f USB: cdc-wdm: fix race between write and disconnect due to flag abuse
In case of a disconnect an ongoing flush() has to be made fail.
Nevertheless we cannot be sure that any pending URB has already
finished, so although they will never succeed, they still must
not be touched.
The clean solution for this is to check for WDM_IN_USE
and WDM_DISCONNECTED in flush(). There is no point in ever
clearing WDM_IN_USE, as no further writes make sense.

The issue is as old as the driver.

Fixes: afba937e54 ("USB: CDC WDM driver")
Reported-by: syzbot+d232cca6ec42c2edb3fc@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190827103436.21143-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-28 22:48:38 +02:00
..
atm
c67x00
chipidea usb: chipidea: udc: don't do hardware access if gadget has stopped 2019-08-21 09:45:49 -07:00
class USB: cdc-wdm: fix race between write and disconnect due to flag abuse 2019-08-28 22:48:38 +02:00
common
core usb: hcd: use managed device resources 2019-08-28 22:48:37 +02:00
dwc2 usb: add a hcd_uses_dma helper 2019-08-15 15:18:05 +02:00
dwc3 Revert "usb:gadget Separated decoding functions from dwc3 driver." 2019-07-04 13:02:09 +02:00
early
gadget usb: udc: lpc32xx: silence fall-through warning 2019-08-21 09:45:46 -07:00
host usb: host: xhci: rcar: Fix typo in compatible string matching 2019-08-28 22:48:38 +02:00
image
isp1760
misc usb: iowarrior: fix deadlock on disconnect 2019-08-08 12:43:18 +02:00
mon
mtu3
musb
phy Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
renesas_usbhs USB: more changes for v5.3 merge window 2019-07-03 13:48:54 +02:00
roles
serial USB: serial: option: add the BroadMobi BM818 card 2019-08-15 13:46:22 +02:00
storage USB: storage: ums-realtek: Whitelist auto-delink support 2019-08-28 22:48:37 +02:00
typec typec: tcpm: fix a typo in the comparison of pdo_max_voltage 2019-08-28 22:48:37 +02:00
usbip
wusbcore
Kconfig dma-mapping updates for Linux 5.3 2019-07-12 15:13:55 -07:00
Makefile Revert "usb:cdns3 Add Cadence USB3 DRD Driver" 2019-07-04 13:01:33 +02:00
usb-skeleton.c