UBUNTU-CVE-2026-98360: Use After Free
In the Linux kernel, the following vulnerability has been resolved: RDMA/rxe: insert mcg into mcgtree only after rxemcastadd() succeeds rxegetmcg() publishes a newly allocated multicast group in rxe->mcgtree before programming the backing Ethernet multicast address with rxemcastadd(), which runs outside mcglock. A local userspace RDMA client reaches this path with ATTACHMCAST on a UD QP; if rxemcastadd() then returns an error (for example -ENODEV when the backing netdev has been removed, or a propagated devmcadd() error), the unwind frees the published group without removing it from the tree. A later lookup of the same MGID dereferences the freed struct rxemcg from rxelookupmcg(). Fix this by keeping the new mcg private until rxemcastadd() succeeds. Split the tree publication into rxepublishmcg(), call rxemcastadd() before taking the tree reference, and free the still-private mcg on failure. Because the group is never visible in mcgtree 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 mcglock finds the winner; this caller then drops its private object and balances its own rxemcastadd() with rxemcastdel() before returning the winner. Reproduced by forcing the rxemcastadd() error return under KASAN: without the change the next attach to the same MGID reports a slab-use-after-free in rxelookupmcg(); 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1
Event History
Frequently Asked Questions
Who can reach the vulnerable path?
A local userspace RDMA client can reach it by using ATTACH_MCAST on a UD queue pair. The affected code is in the RXE RDMA path.
What conditions are required to trigger the use-after-free?
Programming the backing Ethernet multicast address must fail after a new multicast group has been published in the multicast-group tree. The data identifies a removed backing network device returning -ENODEV or an error propagated from dev_mc_add() as examples; a later lookup of the same MGID then dereferences the freed group.
What is the consequence of a successful trigger?
A later lookup can dereference a freed rxe_mcg structure, resulting in a use-after-free. The supplied severity vector rates confidentiality, integrity, and availability impact as high.