Netdev List
 help / color / mirror / Atom feed
* [PATCH net v3 0/2] pds_core: fix use-after-free on workqueue during remove
@ 2026-07-14 18:02 Nikhil P. Rao
  2026-07-14 18:02 ` [PATCH net v3 1/2] pds_core: fix deadlock between reset thread and remove Nikhil P. Rao
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nikhil P. Rao @ 2026-07-14 18:02 UTC (permalink / raw)
  To: netdev
  Cc: kuba, brett.creeley, eric.joyner, andrew+netdev, davem, edumazet,
	pabeni, Nikhil P. Rao

This series fixes a use-after-free on the workqueue during driver remove.

Patch 1 fixes a pre-existing deadlock between the PCI reset worker and
pdsc_remove() that was identified during review of v1.

Patch 2 is the reworked UAF fix that moves destroy_workqueue() after
pdsc_teardown() and adds proper work synchronization.

v3:
- Drop READ_ONCE(qcq->intx) in pdsc_process_adminq(); clear qcq->intx
  after cancel_work_sync() in pdsc_qcq_free() so the work path observes
  a stable value without the barrier (addresses Paolo's v2 comment).
  This removes the adminq.c change entirely.

v2:
- Fix deadlock between pci_reset_thread and remove (new patch 1/2)
  found by sashiko AI review of v1
- Rework UAF fix: move destroy_workqueue() after pdsc_teardown()
  instead of setting wq to NULL (addresses NULL deref found by sashiko)
- Add cancel_work_sync() after free_irq() to drain ISR-queued work
- Reorder adminqcq/notifyqcq freeing to avoid accessing freed notifyqcq

v2: https://lore.kernel.org/netdev/20260629200358.2626129-3-nikhil.rao@amd.com/
v1: https://lore.kernel.org/netdev/20260610025952.196470-1-nikhil.rao@amd.com/

Nikhil P. Rao (2):
  pds_core: fix deadlock between reset thread and remove
  pds_core: fix use-after-free on workqueue during remove

 drivers/net/ethernet/amd/pds_core/core.c | 21 ++++++++++++++-------
 drivers/net/ethernet/amd/pds_core/main.c |  5 +++--
 2 files changed, 17 insertions(+), 9 deletions(-)

--
2.43.0


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

end of thread, other threads:[~2026-07-21 19:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 18:02 [PATCH net v3 0/2] pds_core: fix use-after-free on workqueue during remove Nikhil P. Rao
2026-07-14 18:02 ` [PATCH net v3 1/2] pds_core: fix deadlock between reset thread and remove Nikhil P. Rao
2026-07-21 16:55   ` Simon Horman
2026-07-14 18:02 ` [PATCH net v3 2/2] pds_core: fix use-after-free on workqueue during remove Nikhil P. Rao
2026-07-21 19:50 ` [PATCH net v3 0/2] " patchwork-bot+netdevbpf

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