linux/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
..
buffer.c
config.c Merge 3.14-rc6 into usb-next 2014-03-12 11:40:15 -07:00
devices.c
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
file.c
generic.c
hcd-pci.c USB: fix crash during hotplug of PCI USB controller card 2014-04-16 13:59:12 -07:00
hcd.c
hub.c USB patches for 3.15-rc1 2014-04-01 17:06:09 -07:00
hub.h
Kconfig
Makefile
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
otg_whitelist.h
port.c
quirks.c
sysfs.c
urb.c
usb-acpi.c
usb.c
usb.h USB patches for 3.15-rc1 2014-04-01 17:06:09 -07:00