Skip to content

PCI/AER: Use-after-free fix

Keith Busch linux-pci 1 version Applied

Status from this message: I applied the first two to pci/aer for v4.18, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4PCI/AER: Remove unused parametersdrivers/pci/pcie/aer/aerdrv_core.c+5 -90 replies
2/4PCI/AER: Replace struct pcie_device with pci_devdrivers/pci/pcie/aer/aerdrv.c drivers/pci/pcie/aer/aerdrv.h drivers/pci/pcie/aer/aerdrv_core.c+12 -140 replies
3/4PCI/AER: Reference count aer structuresdrivers/pci/pcie/aer/aerdrv.c drivers/pci/pcie/aer/aerdrv.h drivers/pci/pcie/aer/aerdrv_core.c+23 -40 replies
4/4PCI/AER: Lock pci topology when scanning errorsdrivers/pci/pcie/aer/aerdrv.c drivers/pci/pcie/aer/aerdrv.h drivers/pci/pcie/aer/aerdrv_core.c+2 -83 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] PCI/AER: Use-after-free fix

AER error handling walks the PCI topology below a root port, saving pointers of the pci_dev structs affected by the error along the way.

At the same time, the pcie hotplug driver could be freeing those very same structures, causing the AER driver to reference freed memory.

This series fixes this by synchroniziing the aer driver with the pci hotplug driver during. The final patch is the one that ultimately provides the locking by having AER lock the same pci lock rescan/remove mutex as the pciehp driver. The first three patches are prepping to make it safe for the aer bottom half handler to hold that lock.

Keith Busch (4):
PCI/AER: Remove unused parameters PCI/AER: Replace struct pcie_device with pci_dev PCI/AER: Reference count aer structures PCI/AER: Lock pci topology when scanning errors

 drivers/pci/pcie/aer/aerdrv.c      | 28 +++++++++++++++++++++-------
 drivers/pci/pcie/aer/aerdrv.h      |  9 +++------
 drivers/pci/pcie/aer/aerdrv_core.c | 38 +++++++++++++++++---------------------
 3 files changed, 41 insertions(+), 34 deletions(-)
Signature · 1 line
2.14.3