[PATCH 0/2] dmaengine: idxd: fix crashes in the probe error path
From: Jingyi Li
Date: Tue Oct 27 2026 - 20:37:27 EST
When idxd_probe() fails, the cleanup in idxd_pci_probe_alloc() runs into
two bugs:
1. idxd_free() frees opcap_bmap, the IDA id and idxd after put_device()
has already freed them via idxd_conf_device_release() (double free).
2. idxd_conf_device_release() calls destroy_workqueue() on a NULL
workqueue when probe fails before idxd_setup_internals(), and on an
already destroyed one after idxd_cleanup_internals() or the err_evl
path of idxd_setup_internals().
We hit both in a kdump crash kernel, where the DSA device fails to reset
and reports HALTED. Depending on the kernel version, the crash kernel
either oopses in destroy_workqueue() (2) or corrupts the slab (1), and
no dump is saved.
Testing: the equivalent change was tested on 6.18.57 on 10 systems with
DSA, triggering kdump with idxd loaded in the crash kernel:
- unpatched: 10/10 NULL pointer dereference in destroy_workqueue(),
0/10 dumps saved
- patch 1 only: no change, the oops in (2) happens first
- both patches: 10/10 dumps saved; with slub_debug=FZPU, no slub
reports and no oopses
On 6.18.18, which predates commit 3d33de353b1f, patch 1 alone fixed the
slab corruption (10/10 dumps, previously 0x6b poison faults with
slub_debug).
This series is build-tested with W=1 on top of 7.3-rc4.
Jingyi Li (2):
dmaengine: idxd: fix double free in idxd_free()
dmaengine: idxd: fix destroy of NULL or already destroyed workqueue
drivers/dma/idxd/init.c | 5 ++---
drivers/dma/idxd/sysfs.c | 3 ++-
2 files changed, 4 insertions(+), 4 deletions(-)
base-commit: 93f51579e7df248780214094418f205253383cc5
--
2.43.0