CVE-2026-99522: RDMA/irdma: avoid use-after-free in icrdma_remove
In the Linux kernel, the following vulnerability has been resolved:
RDMA/irdma: avoid use-after-free in icrdmaremove
icrdmaremove() dereferences iwdev after calling irdmaibunregisterdevice():
irdmaibunregisterdevice(iwdev) -> ibunregisterdevice(&iwdev->ibdev) -> ibunregisterdevice() -> ibdeallocdevice()
irdma registers irdmaibdeallocdevice() as the deallocdriver callback in its ibdeviceops. The RDMA core explicitly documents ibunregisterdevice() that when ops.deallocdriver is used, ibdev will be freed upon return from the function.
The ibdevice is embedded in struct irdmadevice and iwdev itself was allocated by iballocdevice(irdmadevice, ibdev). Consequently, once irdmaibunregisterdevice() returns, iwdev must no longer be dereferenced.
However, icrdmaremove() currently accesses iwdev->rf afterwards when deinitializing interrupts, destroying ahtbllock, and freeing rf. Although the final ibdevice storage is released with kfreercu(), the object lifetime has already ended and callers must not rely on the RCU grace period to continue dereferencing iwdev.
Save iwdev->rf before unregistering the RDMA device and use the saved pointer for the remaining cleanup.
This issue was found by manual code inspection.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.3-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1Fixed in 7.3.5-1 - Compensating control
In icrdma_remove(), save iwdev->rf before calling irdma_ib_unregister_device(iwdev), then use the saved pointer for remaining cleanup; do not dereference iwdev after unregistering the RDMA device.