linux/drivers/net/usb
Oliver Neukum 14a0d635d1 usbnet: include wait queue head in device structure
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>
2014-03-27 14:59:10 -04:00
..
asix_common.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
asix_devices.c net: asix: add missing flag to struct driver_info 2014-02-14 15:47:43 -05:00
asix.h drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
ax88172a.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
ax88179_178a.c USB fixes for 3.14-rc6 2014-03-09 18:59:14 -07:00
catc.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cdc_eem.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cdc_ether.c r8152: disable the ECM mode 2014-03-05 20:40:24 -05:00
cdc_mbim.c
cdc_ncm.c net: cdc_ncm: fix control message ordering 2014-03-18 15:32:32 -04:00
cdc_subset.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cdc-phonet.c
cx82310_eth.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
dm9601.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-01-18 00:55:41 -08:00
gl620a.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
hso.c hso: remove some dead code 2014-02-06 21:28:05 -08:00
huawei_cdc_ncm.c
int51x1.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
ipheth.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
kalmia.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
kaweth.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
Kconfig USB2NET: Fix Default to 'y' for SR9800 Device Driver, setting to 'n' 2014-02-13 18:42:01 -05:00
lg-vl600.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
Makefile r8152: disable the ECM mode 2014-03-05 20:40:24 -05:00
mcs7830.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
net1080.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
pegasus.c
pegasus.h
plusb.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
qmi_wwan.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
r8152.c r8152: disable the ECM mode 2014-03-05 20:40:24 -05:00
rndis_host.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
rtl8150.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
sierra_net.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
smsc75xx.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
smsc75xx.h usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
smsc95xx.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
smsc95xx.h usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
sr9700.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
sr9700.h
sr9800.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
sr9800.h USB2NET : SR9800 : One chip USB2.0 USB2NET SR9800 Device Driver Support 2014-02-10 16:53:06 -08:00
usbnet.c usbnet: include wait queue head in device structure 2014-03-27 14:59:10 -04:00
zaurus.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00