pds_core: fix use-after-free on workqueue during remove
Status from this message: This series was applied to netdev/net.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 2 repliesApplied 2/2
- v22 patches 6 repliesSuperseded
- v11 patch 1 replySuperseded
Changes in v3 from the cover letter
- 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.
Patches in v3 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | pds_core: fix deadlock between reset thread and removedrivers/ | +4 | 2 replies | Applied |
| 2/2 | pds_core: fix use-after-free on workqueue during removedrivers/ drivers/ | +13 | 0 replies | Applied |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Harshitha Ramamurthy |
|---|---|
| 1/2 | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net v3 0/2] pds_core: fix use-after-free on workqueue during remove
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/[email protected]/
v1: https://lore.kernel.org/netdev/[email protected]/
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