tmp_suning_uos_patched/drivers/usb
Johan Hovold aafb00a977 USB: yurex: fix NULL-derefs on disconnect
The driver was using its struct usb_interface pointer as an inverted
disconnected flag, but was setting it to NULL without making sure all
code paths that used it were done with it.

Before commit ef61eb43ad ("USB: yurex: Fix protection fault after
device removal") this included the interrupt-in completion handler, but
there are further accesses in dev_err and dev_dbg statements in
yurex_write() and the driver-data destructor (sic!).

Fix this by unconditionally stopping also the control URB at disconnect
and by using a dedicated disconnected flag.

Note that we need to take a reference to the struct usb_interface to
avoid a use-after-free in the destructor whenever the device was
disconnected while the character device was still open.

Fixes: aadd6472d9 ("USB: yurex.c: remove dbg() usage")
Fixes: 45714104b9 ("USB: yurex.c: remove err() usage")
Cc: stable <stable@vger.kernel.org>     # 3.5: ef61eb43ad
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191009153848.8664-6-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-10 14:24:06 +02:00
..
atm
c67x00
cdns3 usb: cdns3: Fix for incorrect DMA mask. 2019-10-10 12:42:09 +02:00
chipidea Add role switch class support for chipidea 2019-09-05 10:02:07 +02:00
class USB: usblp: fix runtime PM after driver unbind 2019-10-04 14:38:45 +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
gadget udc: lpc32xx: fix 64-bit compiler warning 2019-10-04 14:35:19 +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
misc USB: yurex: fix NULL-derefs on disconnect 2019-10-10 14:24:06 +02:00
mon
mtu3 usb: mtu3: register a USB Role Switch for dual role mode 2019-09-03 20:02:15 +02:00
musb
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 fixes for 5.4-rc2 2019-10-04 16:01: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