Skip to contentSkip to conversation

CVE-2026-99522: RDMA/irdma: avoid use-after-free in icrdma_remove

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 19

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

RDMA/irdma: avoid use-after-free in icrdma_remove

icrdma_remove() dereferences iwdev after calling
irdma_ib_unregister_device():

irdma_ib_unregister_device(iwdev)

    -> ib_unregister_device(&iwdev->ibdev)
      -> __ib_unregister_device()
        -> ib_dealloc_device()

irdma registers irdma_ib_dealloc_device() as the dealloc_driver callback in its ib_device_ops. The RDMA core explicitly documents ib_unregister_device() that when ops.dealloc_driver is used, ib_dev will be freed upon return from the function.

The ib_device is embedded in struct irdma_device and iwdev itself was allocated by ib_alloc_device(irdma_device, ibdev). Consequently, once irdma_ib_unregister_device() returns, iwdev must no longer be dereferenced.

However, icrdma_remove() currently accesses iwdev->rf afterwards when deinitializing interrupts, destroying ah_tbl_lock, and freeing rf. Although the final ib_device storage is released with kfree_rcu(), 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.

The Linux kernel CVE team has assigned CVE-2026-99522 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.14 with commit 8498a30e1b9484629598cce97d200f517445e26b and fixed in 6.18.61 with commit e5388f15d595dd4d7599a43e9cb58c0656a6aec6
	Issue introduced in 5.14 with commit 8498a30e1b9484629598cce97d200f517445e26b and fixed in 7.3.2 with commit 47eb0ec18f7bbd40cf1f1d261f15ef3c03e4c8d6
	Issue introduced in 5.14 with commit 8498a30e1b9484629598cce97d200f517445e26b and fixed in 7.4-rc1 with commit 8a8088b899e4cdfe558428cd6113d45df81625be

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-99522

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/infiniband/hw/irdma/icrdma_if.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/e5388f15d595dd4d7599a43e9cb58c0656a6aec6
	https://git.kernel.org/stable/c/47eb0ec18f7bbd40cf1f1d261f15ef3c03e4c8d6
	https://git.kernel.org/stable/c/8a8088b899e4cdfe558428cd6113d45df81625be