]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: harden xhci_find_next_ext_cap against device removal
authorJoe Lawrence <joe.lawrence@stratus.com>
Wed, 3 Feb 2016 17:51:12 +0000 (12:51 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Feb 2016 01:00:10 +0000 (17:00 -0800)
commit1cdc1c3a7e972f7796606ee0aa48e954bf9eb029
treec7abad88a88cfe4fe2d599eff868a59e18f16f17
parent0fdfc16c99d0d604cec3dcac43f445f270ec580a
xhci: harden xhci_find_next_ext_cap against device removal

xhci_find_next_ext_cap doesn't check for PCI hotplug removal and may use
the PCI master abort bit pattern (~0) to calculate a new PCI address
offset to read/write.  The has lead to reproducable crashes when testing
surprise removal during device initialization on a Stratus platform, at
least after commit 548b5952caa1 ("xhci: rework xhci extended capability
list parsing functions").

The crash is repeatable on a Stratus platform when injecting hardware
faults to induce xHCI host controller hotplug during driver
initialization.  If a PCI read in xhci_find_next_ext_cap returns the
master abort pattern, quirk_usb_handoff_xhci may start using a bogus
ext_cap_offset to start searching more bogus PCI addresses.

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ext-caps.h