mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] PCI: Fix ECAM config window use-after-free in five drivers
@ 2026-11-08 10:56 Hongyan Xu
  2026-11-08 10:56 ` [PATCH 1/3] PCI: apple: Fix ECAM config window use-after-free Hongyan Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hongyan Xu @ 2026-11-08 10:56 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: Marc Zyngier, Daire McNamara, Conor Dooley, Robert Richter,
	Zhou Wang, Lorenzo Pieralisi, Krzysztof Wilczynski,
	Manivannan Sadhasivam, Rob Herring, linux-arm-kernel,
	linux-riscv, linux-kernel, stable, Hongyan Xu

Five PCI host controller drivers use pci_host_common_probe() or
pci_host_common_init() but install no ->remove, so unbinding frees the ECAM
config window through devres while the bus tree is still registered, and
the next config space access is a use-after-free.

Patch 1/3 is the apple driver.  CONFIG_PCIE_APPLE=m plus
module_platform_driver() means one root command, "rmmod apple_pcie", is
enough to trigger it.

This series fixes the lifetime of cfg only.  It does not make these drivers
safe to unload: apple's IRQ handlers and microchip's PLDA IRQ domains are
still not released, both pre-existing and out of scope here.

The defect was found by code review; the trigger steps are in each patch,
but no oops or KASAN report is attached, as none was measured.

Patch 3/3 is one commit for the three remaining drivers and therefore
carries three Fixes: tags; it can be split apart if you prefer.

Hongyan Xu (3):
  PCI: apple: Fix ECAM config window use-after-free
  PCI: microchip: Fix ECAM config window use-after-free
  PCI: thunder-pem, hisi, thunder-ecam: Fix ECAM config window
    use-after-free

 drivers/pci/controller/dwc/pcie-hisi.c            | 1 +
 drivers/pci/controller/pci-thunder-ecam.c         | 1 +
 drivers/pci/controller/pci-thunder-pem.c          | 1 +
 drivers/pci/controller/pcie-apple.c               | 1 +
 drivers/pci/controller/plda/pcie-microchip-host.c | 1 +
 5 files changed, 5 insertions(+)

-- 
2.50.1.windows.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-08 10:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-08 10:56 [PATCH 0/3] PCI: Fix ECAM config window use-after-free in five drivers Hongyan Xu
2026-11-08 10:56 ` [PATCH 1/3] PCI: apple: Fix ECAM config window use-after-free Hongyan Xu
2026-11-08 10:56 ` [PATCH 2/3] PCI: microchip: " Hongyan Xu
2026-11-08 10:56 ` [PATCH 3/3] PCI: thunder-pem, hisi, thunder-ecam: " Hongyan Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®