Thread (3 messages) 3 messages, 1 author, 5h ago
HOTtoday
Revisions (2)
  1. v2 [diff vs current]
  2. v3 current

[PATCH net v3 0/2] pds_core: fix use-after-free on workqueue during remove

From: Nikhil P. Rao <hidden>
Date: 2026-07-14 18:10:40

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/ (local)
v1: https://lore.kernel.org/netdev/20260610025952.196470-1-nikhil.rao@amd.com/ (local)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help