Re: [PATCH 0/3] PCI: Fix ECAM config window use-after-free in five drivers

From: Manivannan Sadhasivam

Date: Sun Nov 29 2026 - 08:44:08 EST


On 2026-11-08 18:56 +0800, Hongyan Xu wrote:
> 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.
>

As Marc stated, you should prevent these drivers from unbinding by setting
'suppress_bind_attrs' to properly fix this issue.

- Mani