linux-sg2042/drivers/usb/core
Alan Stern a2ff864b53 USB: fix crash during hotplug of PCI USB controller card
The code in hcd-pci.c that matches up EHCI controllers with their
companion UHCI or OHCI controllers assumes that the private drvdata
fields don't get set too early.  However, it turns out that this field
gets set by usb_create_hcd(), before hcd-pci expects it, and this can
result in a crash when two controllers are probed in parallel (as can
happen when a new controller card is hotplugged).

The companions_rwsem lock was supposed to prevent this sort of thing,
but usb_create_hcd() is called outside the scope of the rwsem.

A simple solution is to check that the root-hub pointer has been
initialized as well as the drvdata field.  This doesn't happen until
usb_add_hcd() is called; that call and the check are both protected by
the rwsem.

This patch should be applied to stable kernels from 3.10 onward.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Stefani Seibold <stefani@seibold.net>
Tested-by: Stefani Seibold <stefani@seibold.net>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16 13:59:12 -07:00
..
Kconfig Kconfig: Remove useless "default N" lines 2014-02-20 14:38:06 +01:00
Makefile USB: core: remove CONFIG_USB_DEBUG usage 2013-12-21 16:01:00 -08:00
buffer.c USB: core: correct spelling mistakes in comments and warning 2014-01-07 16:17:40 -08:00
config.c Merge 3.14-rc6 into usb-next 2014-03-12 11:40:15 -07:00
devices.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
devio.c USB patches for 3.15-rc1 2014-04-01 17:06:09 -07:00
driver.c USB: unbind all interfaces before rebinding any 2014-03-17 16:08:27 -07:00
endpoint.c USB: core: be specific about attribute permissions 2013-08-25 15:12:03 -07:00
file.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-11-13 15:34:18 +09:00
generic.c staging: usbip: convert usbip-host driver to usb_device_driver 2014-02-07 10:54:30 -08:00
hcd-pci.c USB: fix crash during hotplug of PCI USB controller card 2014-04-16 13:59:12 -07:00
hcd.c usb-core: Track if an endpoint has streams 2014-03-04 15:38:03 -08:00
hub.c USB patches for 3.15-rc1 2014-04-01 17:06:09 -07:00
hub.h usbcore: rename struct dev_state to struct usb_dev_state 2014-03-10 09:54:56 -07:00
message.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
notify.c usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
otg_whitelist.h
port.c USB: core: be specific about attribute permissions 2013-08-25 15:12:03 -07:00
quirks.c usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e 2014-03-07 11:46:51 -08:00
sysfs.c USB: core: correct spelling mistakes in comments and warning 2014-01-07 16:17:40 -08:00
urb.c Merge branch 'master' into for-next 2014-02-20 14:54:28 +01:00
usb-acpi.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
usb.c drivers: usb: core: {file,hub,sysfs,usb}.c: Whitespace fixes 2013-10-11 17:02:37 -07:00
usb.h USB patches for 3.15-rc1 2014-04-01 17:06:09 -07:00