mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
PCI: dwc: Protect root bus removal with rescan lock
Hold the pci_rescan_remove_lock lock while stopping and removing a root bus to avoid racing with concurrent rescan or hotplug operations triggered via sysfs. Such races may lead to use-after-free issues or system crashes. Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20260521161822.132996-3-18255117159@163.com
This commit is contained in:
parent
713331969c
commit
2633569649
|
|
@ -703,8 +703,10 @@ void dw_pcie_host_deinit(struct dw_pcie_rp *pp)
|
|||
|
||||
dwc_pcie_debugfs_deinit(pci);
|
||||
|
||||
pci_lock_rescan_remove();
|
||||
pci_stop_root_bus(pp->bridge->bus);
|
||||
pci_remove_root_bus(pp->bridge->bus);
|
||||
pci_unlock_rescan_remove();
|
||||
|
||||
dw_pcie_stop_link(pci);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user