HIGH Introduced in 5.18
rxe McastGroup UAF
CVE-2026-98360
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: RDMA/rxe: insert mcg into mcg_tree only after rxe_mcast_add() succeeds rxe_get_mcg() publishes a newly allocated multicast group in rxe->mcg_tree before programming the backing Ethernet multicast address with rxe_mcast_add(), which runs outside mcg_lock. A local userspace RDMA client reaches this path with ATTACH_MCAST on a UD QP; if rxe_mcast_add() then returns an error (for example -ENODEV when the backing netdev has been removed, or a propagated dev_mc_add() error), the unwind frees the published group without removing it from the tree. A later lookup of the same MGID dereferences the freed struct rxe_mcg from __rxe_lookup_mcg(). Fix this by keeping the new mcg private until rxe_mcast_add() succeeds. Split the tree publication into __rxe_publish_mcg(), call rxe_mcast_add() before taking the tree reference, and free the still-private mcg on failure. Because the group is never visible in mcg_tree until the multicast address is programmed, no concurrent caller can look it up or attach a QP to a group that is about to be torn down, so the error path needs no conditional unwind. If another caller publishes the same MGID while the address is being programmed, the post-add re-check under mcg_lock finds the winner; this caller then drops its private object and balances its own rxe_mcast_add() with rxe_mcast_del() before returning the winner. Reproduced by forcing the rxe_mcast_add() error return under KASAN: without the change the next attach to the same MGID reports a slab-use-after-free in __rxe_lookup_mcg(); with it the forced failure returns cleanly. A no-injection attach/detach regression, including a two-QP shared join/leave and re-attach, stays KASAN- and leak-clean.
02KernelScan AI Analysis
Risk summary
A local user with access to an rxe RDMA device can trigger a use-after-free by issuing a multicast group attach when the backing network interface is in an error state. The freed multicast group object remains in the kernel's lookup tree and is dereferenced on a subsequent attach to the same group, potentially leading to arbitrary code execution or a kernel crash. Systems running the rxe soft-RDMA module with local user access to RDMA verbs are affected.
Vulnerability analysis
The rxe software RDMA driver inserts a newly allocated multicast group into its internal lookup tree before programming the corresponding Ethernet multicast address on the backing network interface. If that address programming fails—because the backing interface has been removed or the hardware multicast filter cannot accept the address—the error cleanup frees the group object but leaves the dangling pointer in the tree. A subsequent multicast attach for the same group address looks up and dereferences the freed object, resulting in a use-after-free. The fix keeps the new group private until the multicast address is successfully programmed; only then is it published into the tree, so on failure the never-visible object is simply freed with no tree cleanup needed. A local process with access to the RDMA verbs device can trigger this by issuing a multicast attach operation when the backing interface is in an error state; the rxe module must be loaded and an rxe device must already be configured.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 5.18 | 6.1.189 | ddb43ac0926d |
| 6.12 | 5.18 | 6.12.112 | faae1fb4ccf8 |
| 6.18 | 5.18 | 6.18.54 | 02c0a2fa69c1 |
| 6.6 | 5.18 | 6.6.158 | c79a789aa151 |
| 7.2 | 5.18 | 7.2.8 | d4fc4e37f8a1 |
| mainline | 5.18 | 7.3 | 1caceeb2d74b |
| cip/6.1 | 5.18 | 6.1.189-cip61 | ddb43ac0926d |
| cip/6.1-rt | 5.18 | 6.1.189-cip61-rt32 | ddb43ac0926d |
| cip/6.12 | 5.18 | 6.12.112-cip33 | faae1fb4ccf8 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.112-cip33 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |