linux-stable/drivers/pci/pcie
David Daney 7e8fbdc628 PCI/AER: Restore pci_ops pointer while calling original pci_ops
The aer_inject module intercepts config space accesses by replacing the
bus->ops pointer.  If it forwards accesses to the original pci_ops, and
those original ops use bus->ops, they see the aer_pci_ops instead of their
own pci_ops, which can cause a crash.

For example, pci_generic_config_read() uses the bus->ops->map_bus pointer.
If bus->ops is set to aer_pci_ops, which doesn't supply .map_bus,
pci_generic_config_read() will dereference an invalid pointer and cause a
crash.

Temporarily restore the original bus->ops pointer while calling ops->read()
or ops->write().  Callers of these functions already hold pci_lock, which
prevents other users of bus->ops until we're finished.

[bhelgaas: changelog]
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-02-04 14:26:27 -06:00
..
aer PCI/AER: Restore pci_ops pointer while calling original pci_ops 2016-02-04 14:26:27 -06:00
aspm.c PCI/ASPM: Make sysfs link_state_store() consistent with link_state_show() 2015-12-03 10:42:59 -06:00
Kconfig PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core 2014-12-04 00:50:33 +01:00
Makefile PCI: PCIe: Move PCIe PME code to the pcie directory 2010-08-24 13:47:48 -07:00
pme.c PCI / PM: handle failure to enable wakeup on PCIe PME 2014-10-23 22:47:28 +02:00
portdrv.h PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
portdrv_acpi.c PCI: Fix missing prototype for pcie_port_acpi_setup() 2013-04-12 11:17:47 -06:00
portdrv_bus.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
portdrv_core.c PCI: Fix pcie_port_device_resume() comment 2015-07-14 13:41:04 -05:00
portdrv_pci.c PCI/PM: Drop unused runtime PM support code for PCIe ports 2014-09-02 17:12:15 -06:00