linux-imx/include/linux/usb
Oliver Neukum 0631987d44 usbnet: include wait queue head in device structure
[ Upstream commit 14a0d635d1 ]

This fixes a race which happens by freeing an object on the stack.
Quoting Julius:
> The issue is
> that it calls usbnet_terminate_urbs() before that, which temporarily
> installs a waitqueue in dev->wait in order to be able to wait on the
> tasklet to run and finish up some queues. The waiting itself looks
> okay, but the access to 'dev->wait' is totally unprotected and can
> race arbitrarily. I think in this case usbnet_bh() managed to succeed
> it's dev->wait check just before usbnet_terminate_urbs() sets it back
> to NULL. The latter then finishes and the waitqueue_t structure on its
> stack gets overwritten by other functions halfway through the
> wake_up() call in usbnet_bh().

The fix is to just not allocate the data structure on the stack.
As dev->wait is abused as a flag it also takes a runtime PM change
to fix this bug.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Reported-by: Grant Grundler <grundler@google.com>
Tested-by: Grant Grundler <grundler@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2014-04-18 11:07:13 +02:00
..
association.h
atmel_usba_udc.h
audio-v2.h
audio.h
c67x00.h
cdc_ncm.h
cdc-wdm.h
ch9.h
chipidea.h usb: chipidea: add freescale imx28 special write register method 2014-02-06 11:22:14 -08:00
composite.h
ehci_def.h
ehci_pdriver.h ehci-platform: add pre_setup() method to platform data 2013-06-11 16:10:45 +09:00
ezusb.h
functionfs.h
g_hid.h
gadget_configfs.h
gadget.h usb: gadget: udc-core: move sysfs_notify() to a workqueue 2013-07-29 13:57:02 +03:00
gpio_vbus.h
hcd.h USB: fix build error when CONFIG_PM_SLEEP isn't enabled 2013-08-30 11:12:06 -07:00
input.h
intel_mid_otg.h
iowarrior.h
irda.h
isp116x.h
isp1301.h
isp1362.h
isp1760.h
m66592.h
msm_hsusb_hw.h
msm_hsusb.h
musb-omap.h
musb-ux500.h
musb.h
net2280.h
of.h usb: of: fix build breakage caused by recent patches 2013-07-30 09:09:15 +03:00
ohci_pdriver.h
omap_control_usb.h
omap_usb.h
otg.h usb: add devicetree helpers for determining dr_mode and phy_type 2013-06-17 13:47:09 -07:00
phy_companion.h
phy.h usb: phy: protect against NULL phy pointers 2013-07-29 13:56:45 +03:00
quirks.h
r8a66597.h
renesas_usbhs.h
rndis_host.h
samsung_usb_phy.h
serial.h USB: serial: increase the number of devices we support 2013-06-17 13:34:15 -07:00
sl811.h
storage.h
tegra_usb_phy.h usb: phy: tegra: Program new PHY parameters 2013-08-12 13:29:52 -05:00
tilegx.h
uas.h
ulpi.h
usb_phy_gen_xceiv.h usb: usb_phy_gen: refine conditional declaration of usb_nop_xceiv_register 2013-10-17 09:34:30 -07:00
usbnet.h usbnet: include wait queue head in device structure 2014-04-18 11:07:13 +02:00
wusb-wa.h USB: WUSBCORE: clear RPIPE stall for control endpoints 2013-08-15 17:35:31 -07:00
wusb.h