mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] PCI: plda: Fix IRQ teardown and error-path resource leaks
@ 2026-07-23 14:04 Ali Tariq
  2026-07-23 14:04 ` [PATCH v3 1/2] PCI: plda: Fix use-after-free of event IRQs during teardown Ali Tariq
  2026-07-29 16:31 ` [PATCH v3 0/2] PCI: plda: Fix IRQ teardown and error-path resource leaks Manivannan Sadhasivam
  0 siblings, 2 replies; 3+ messages in thread
From: Ali Tariq @ 2026-07-23 14:04 UTC (permalink / raw)
  To: daire.mcnamara
  Cc: lpieralisi, kwilczynski, mani, robh, bhelgaas, minda.chen,
	conor.dooley, mason.huo, linux-pci, linux-kernel, stable,
	alitariq45892

This series fixes two related IRQ-handling bugs in the PLDA PCIe
driver, both originally found by automated review from sashiko-bot
during work on an earlier, unrelated patch.

Patch 1 fixes a use-after-free: plda_pcie_irq_domain_deinit() removed
pcie->event_domain while devm-managed event IRQs requested from that
domain still had their free_irq() deferred by devres, so the deferred
cleanup could dereference an already-freed domain. It also hardens
the function so it is safe to call from partially-initialized state
(guards IRQ fields against being 0, and disposes of IRQ mappings
before their domains are torn down).

Patch 2 fixes resource leaks in plda_init_interrupts(): several error
paths returned directly without unwinding IRQ mappings or domains
already created earlier in the function. It adds shared error-handling
labels that call plda_pcie_irq_domain_deinit(), relying on the mapping
disposal added in patch 1.

Patch 2 depends on patch 1 and should not be applied on its own.

Both patches were build-tested and boot-tested on a StarFive
VisionFive v1.2A board.

Changes in v3:
- See individual patches for per-patch changes.

Ali Tariq (2):
  PCI: plda: Fix use-after-free of event IRQs during teardown
  PCI: plda: Fix resource leaks on error paths in plda_init_interrupts()

 drivers/pci/controller/plda/pcie-plda-host.c | 52 ++++++++++++++++----
 1 file changed, 42 insertions(+), 10 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2026-07-29 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-23 14:04 [PATCH v3 0/2] PCI: plda: Fix IRQ teardown and error-path resource leaks Ali Tariq
2026-07-23 14:04 ` [PATCH v3 1/2] PCI: plda: Fix use-after-free of event IRQs during teardown Ali Tariq
2026-07-29 16:31 ` [PATCH v3 0/2] PCI: plda: Fix IRQ teardown and error-path resource leaks Manivannan Sadhasivam

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®