linux-kernel-test/drivers/usb/core
Alan Stern cde217a556 USB: fix crash when URBs are unlinked after the device is gone
This patch (as1151) protects usbcore against drivers that try to
unlink an URB after the URB's device or bus have been removed.  The
core does not currently check for this, and certain drivers can cause
a crash if they are running while an HCD is unloaded.

Certainly it would be best to fix the guilty drivers.  But a little
defensive programming doesn't hurt, especially since it appears that
quite a few drivers need to be fixed.

The patch prevents the problem by grabbing a reference to the device
while an unlink is in progress and using a new spinlock to synchronize
unlinks with device removal.  (There's no need to acquire a reference
to the bus as well, since the device structure itself keeps a
reference to the bus.)  In addition, the kerneldoc is updated to
indicate that URBs should not be unlinked after the disconnect method
returns.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-29 14:54:40 -07:00
..
buffer.c USB: fix codingstyle issues in drivers/usb/core/*.c 2008-02-01 14:35:08 -08:00
config.c USB: ehci tolerates some buggy devices 2008-04-24 21:16:35 -07:00
devices.c usb: hub: add check for unsupported bus topology 2008-07-21 15:16:26 -07:00
devio.c USB: remove err() macro from usb core code 2008-10-17 14:41:11 -07:00
driver.c USB: don't rebind drivers after failed resume or reset 2008-10-22 10:05:29 -07:00
endpoint.c USB: remove err() macro from usb core code 2008-10-17 14:41:11 -07:00
file.c USB: remove err() macro from usb core code 2008-10-17 14:41:11 -07:00
generic.c USB: fix possible deadlock involving sysfs attributes 2008-05-29 13:59:03 -07:00
hcd-pci.c USB: clarify usage of hcd->suspend/resume methods 2008-04-24 21:16:48 -07:00
hcd.c USB: fix crash when URBs are unlinked after the device is gone 2008-10-29 14:54:40 -07:00
hcd.h USB: fix crash when URBs are unlinked after the device is gone 2008-10-29 14:54:40 -07:00
hub.c USB: fix crash when URBs are unlinked after the device is gone 2008-10-29 14:54:40 -07:00
hub.h wusb: make ep0_reinit available for modules 2008-04-24 21:16:59 -07:00
inode.c USB: remove err() macro from usb core code 2008-10-17 14:41:11 -07:00
Kconfig usb core: fix USB_OTG_BLACKLIST_HUB typo 2008-10-17 14:40:54 -07:00
Makefile
message.c USB: remove warn() macro from usb drivers 2008-10-17 14:41:09 -07:00
notify.c
otg_whitelist.h USB: fix codingstyle issues in drivers/usb/core/*.h 2008-02-01 14:35:07 -08:00
quirks.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2008-06-17 18:10:40 -07:00
sysfs.c USB: Export if an interface driver supports autosuspend. 2008-10-17 14:41:03 -07:00
urb.c USB: fix crash when URBs are unlinked after the device is gone 2008-10-29 14:54:40 -07:00
usb.c USB: Add new PM callback methods for USB 2008-08-21 10:26:37 -07:00
usb.h USB: Add new PM callback methods for USB 2008-08-21 10:26:37 -07:00