1. 04 Feb, 2016 2 commits
    • David Daney's avatar
      PCI/AER: Restore pci_ops pointer while calling original pci_ops · 7e8fbdc6
      David Daney authored
      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: default avatarDavid Daney <david.daney@cavium.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      7e8fbdc6
    • Bjorn Helgaas's avatar
      PCI/AER: Rename pci_ops_aer to aer_inj_pci_ops · 3b0a6d1a
      Bjorn Helgaas authored
      Rename
      
        pci_ops_aer     to aer_inj_pci_ops
        pci_read_aer()  to aer_inj_read_config()
        pci_write_aer() to aer_inj_write_config()
      
      This is more conventional and more informative.  No functional change.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      3b0a6d1a
  2. 24 Jan, 2016 38 commits