CVE-2025-21714: RDMA/mlx5: Fix implicit ODP use after free
In the Linux kernel, the following vulnerability has been resolved:
RDMA/mlx5: Fix implicit ODP use after free
Prevent double queueing of implicit ODP mr destroy work by using
__xa_cmpxchg() to make sure this is the only time we are destroying this
specific mr.
Without this change, we could try to invalidate this mr twice, which in
turn could result in queuing a MR work destroy twice, and eventually the
second work could execute after the MR was freed due to the first work,
causing a user after free and trace below.
refcount_t: underflow; use-after-free.
WARNING: CPU: 2 PID: 12178 at lib/refcount.c:28 refcount_warn_saturate+0x12b/0x130
Modules linked in: bonding ib_ipoib vfio_pci ip_gre geneve nf_tables ip6_gre gre ip6_tunnel tunnel6 ipip tunnel4 ib_umad rdma_ucm mlx5_vfio_pci vfio_pci_core vfio_iommu_type1 mlx5_ib vfio ib_uverbs mlx5_core iptable_raw openvswitch nsh rpcrdma ib_iser libiscsi scsi_transport_iscsi rdma_cm iw_cm ib_cm ib_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay zram zsmalloc fuse [last unloaded: ib_uverbs]
CPU: 2 PID: 12178 Comm: kworker/u20:5 Not tainted 6.5.0-rc1_net_next_mlx5_58c644e #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
Workqueue: events_unbound free_implicit_child_mr_work [mlx5_ib]
RIP: 0010:refcount_warn_saturate+0x12b/0x130
Code: 48 c7 c7 38 95 2a 82 c6 05 bc c6 fe 00 01 e8 0c 66 aa ff 0f 0b 5b c3 48 c7 c7 e0 94 2a 82 c6 05 a7 c6 fe 00 01 e8 f5 65 aa ff <0f> 0b 5b c3 90 8b 07 3d 00 00 00 c0 74 12 83 f8 01 74 13 8d 50 ff
RSP: 0018:ffff8881008e3e40 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
RDX: ffff88852c91b5c8 RSI: 0000000000000001 RDI: ffff88852c91b5c0
RBP: ffff8881dacd4e00 R08: 00000000ffffffff R09: 0000000000000019
R10: 000000000000072e R11: 0000000063666572 R12: ffff88812bfd9e00
R13: ffff8881c792d200 R14: ffff88810011c005 R15: ffff8881002099c0
FS: 0000000000000000(0000) GS:ffff88852c900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f5694b5e000 CR3: 00000001153f6003 CR4: 0000000000370ea0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
? refcount_warn_saturate+0x12b/0x130
free_implicit_child_mr_work+0x180/0x1b0 [mlx5_ib]
process_one_work+0x1cc/0x3c0
worker_thread+0x218/0x3c0
kthread+0xc6/0xf0
ret_from_fork+0x1f/0x30
</TASK>
Security readout for executives and security teams
Plain-English summary
A flaw in the Linux mlx5 RDMA driver can schedule the same memory object for destruction twice. The second cleanup may access memory already freed by the first, potentially compromising confidentiality, integrity, or availability. Exploitation requires local low-privilege access and relevant RDMA functionality, so exposure is concentrated in RDMA-enabled servers rather than general internet-facing Linux systems.
Executive priority
Treat as a high-priority infrastructure patch for shared RDMA, HPC, virtualization, and multi-tenant systems using mlx5. Standard Linux servers without relevant RDMA use have lower practical urgency. First establish feature reachability, then patch exposed hosts through normal kernel maintenance. Emergency internet-wide action is not supported by the supplied evidence.
Technical view
The mlx5 implicit on-demand paging path can double-queue destruction of a memory region. A later worker may invalidate the already-freed region, producing a CWE-416 use-after-free and refcount underflow. The linked stable fixes use __xa_cmpxchg() to ensure only one destruction attempt proceeds. CVSS 3.1 is 7.8: local, low complexity, low privileges, no user interaction.
Likely exposure
Likely exposure is limited to affected Linux kernels using the mlx5_ib RDMA driver with implicit ODP. Systems permitting untrusted users, containers, or tenants to access RDMA deserve priority. The supplied affected-version data includes 5.5, 6.12.13, 6.13.2, and 6.14, but its exact range semantics are incomplete; verify distribution-specific status.
Exploitation context
The CVSS vector describes a local, low-privilege attack with no user interaction. The source bundle contains a reproduced kernel warning and use-after-free trace, but no evidence of public weaponization or active exploitation. The CVE is not listed as KEV in the supplied data. Internet exposure alone does not establish reachability.
Researcher notes
The failure involves duplicate invalidation and destruction work for an implicit ODP memory region. The second worker can run after the first frees the object. The fix provides atomic ownership of destruction through __xa_cmpxchg(). The bundle does not establish reliable release-range boundaries, exploitability beyond the reported trace, or active exploitation; downstream advisories are needed for build-level conclusions.
Mitigation direction
Update to a vendor-supported kernel containing the applicable linked stable fix or backport.
Prioritize RDMA hosts accessible by untrusted local users, workloads, containers, or tenants.
If patching is delayed, restrict untrusted access to mlx5 RDMA functionality pending vendor guidance.
Consult the Linux distributor's advisory for precise affected and fixed package versions.
Validation and detection
Inventory running kernels where mlx5_ib, RDMA, and implicit ODP are used.
Map each kernel build against the CVE record and distributor-specific advisories.
Verify package changelogs or kernel sources include the applicable linked fix or backport.
Review kernel logs for refcount underflow or free_implicit_child_mr_work warnings.
After updating, validate RDMA workloads and confirm the running kernel is the remediated build.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-416: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
3Timeline events
1ADP providers
4Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-416 · source CWE mapping
Use After Free
Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.