# CVE-2025-21732: RDMA/mlx5: Fix a race for an ODP MR which leads to CQE with error

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.19% (percentile 5, 2026-11-26)
- **CWE:** CWE-362
- **Published:** 2025-02-27T02:12:10.626Z
- **Modified:** 2026-11-05T21:17:41.780Z

## Who should check

- Anyone running Linux \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< 63126215de7beebb662fcef7c7558c795000c904; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< b13d32786acabf70a7b04ed24b7468fc3c82977c; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< 5297f5ddffef47b94172ab0d3d62270002a3dcc1; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< abb604a1a9c87255c7a6f3b784410a9707baf467
- Anyone running Linux 5.13

## Description

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

RDMA/mlx5: Fix a race for an ODP MR which leads to CQE with error

This patch addresses a race condition for an ODP MR that can result in a
CQE with an error on the UMR QP.

During the \_\_mlx5\_ib\_dereg\_mr() flow, the following sequence of calls
occurs:

mlx5\_revoke\_mr()
 mlx5r\_umr\_revoke\_mr()
 mlx5r\_umr\_post\_send\_wait()

At this point, the lkey is freed from the hardware's perspective.

However, concurrently, mlx5\_ib\_invalidate\_range() might be triggered by
another task attempting to invalidate a range for the same freed lkey.

This task will:
 - Acquire the umem\_odp-\>umem\_mutex lock.
 - Call mlx5r\_umr\_update\_xlt() on the UMR QP.
 - Since the lkey has already been freed, this can lead to a CQE error,
   causing the UMR QP to enter an error state \[1\].

To resolve this race condition, the umem\_odp-\>umem\_mutex lock is now also
acquired as part of the mlx5\_revoke\_mr() scope.  Upon successful revoke,
we set umem\_odp-\>private which points to that MR to NULL, preventing any
further invalidation attempts on its lkey.

\[1\] From dmesg:

   infiniband rocep8s0f0: dump\_cqe:277:(pid 0): WC error: 6, Message: memory bind operation error
   cqe\_dump: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   cqe\_dump: 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   cqe\_dump: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   cqe\_dump: 00000030: 00 00 00 00 08 00 78 06 25 00 11 b9 00 0e dd d2

   WARNING: CPU: 15 PID: 1506 at drivers/infiniband/hw/mlx5/umr.c:394 mlx5r\_umr\_post\_send\_wait+0x15a/0x2b0 \[mlx5\_ib\]
   Modules linked in: ip6table\_mangle ip6table\_natip6table\_filter ip6\_tables iptable\_mangle xt\_conntrack xt\_MASQUERADE nf\_conntrack\_netlink nfnetlink xt\_addrtype iptable\_nat nf\_nat br\_netfilter rpcsec\_gss\_krb5 auth\_rpcgss oid\_registry overlay rpcrdma rdma\_ucm ib\_iser libiscsi scsi\_transport\_iscsi rdma\_cm iw\_cm ib\_umad ib\_ipoib ib\_cm mlx5\_ib ib\_uverbs ib\_core fuse mlx5\_core
   CPU: 15 UID: 0 PID: 1506 Comm: ibv\_rc\_pingpong Not tainted 6.12.0-rc7+ \#1626
   Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
   RIP: 0010:mlx5r\_umr\_post\_send\_wait+0x15a/0x2b0 \[mlx5\_ib\]
   \[..\]
   Call Trace:
   \<TASK\>
   mlx5r\_umr\_update\_xlt+0x23c/0x3e0 \[mlx5\_ib\]
   mlx5\_ib\_invalidate\_range+0x2e1/0x330 \[mlx5\_ib\]
   \_\_mmu\_notifier\_invalidate\_range\_start+0x1e1/0x240
   zap\_page\_range\_single+0xf1/0x1a0
   madvise\_vma\_behavior+0x677/0x6e0
   do\_madvise+0x1a2/0x4b0
   \_\_x64\_sys\_madvise+0x25/0x30
   do\_syscall\_64+0x6b/0x140
   entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e

## Affected and fixed versions

- Linux: \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< 63126215de7beebb662fcef7c7558c795000c904; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< b13d32786acabf70a7b04ed24b7468fc3c82977c; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< 5297f5ddffef47b94172ab0d3d62270002a3dcc1; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< abb604a1a9c87255c7a6f3b784410a9707baf467 (cvelist)
- Linux: 5.13 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-21732. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21732.md
Affected: Linux >= e6fb246ccafbdfc86e0750af021628132fdbceac, < 63126215de7beebb662fcef7c7558c795000c904; >= e6fb246ccafbdfc86e0750af021628132fdbceac, < b13d32786acabf70a7b04ed24b7468fc3c82977c; >= e6fb246ccafbdfc86e0750af021628132fdbceac, < 5297f5ddffef47b94172ab0d3d62270002a3dcc1; >= e6fb246ccafbdfc86e0750a…
Fixed in: Linux 63126215de7beebb662fcef7c7558c795000c904, Linux 5297f5ddffef47b94172ab0d3d62270002a3dcc1

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-21732 being exploited?

There is no confirmed exploitation: CVE-2025-21732 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.19% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-21732?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2025-21732?

Linux \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< 63126215de7beebb662fcef7c7558c795000c904; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< b13d32786acabf70a7b04ed24b7468fc3c82977c; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< 5297f5ddffef47b94172ab0d3d62270002a3dcc1; \>= e6fb246ccafbdfc86e0750af021628132fdbceac, \< abb604a1a9c87255c7a6f3b784410a9707baf467; Linux 5.13.

### Is there a fix for CVE-2025-21732?

Yes. Fixed in Linux 63126215de7beebb662fcef7c7558c795000c904, Linux 5297f5ddffef47b94172ab0d3d62270002a3dcc1. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-21732?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/b13d32786acabf70a7b04ed24b7468fc3c82977c>
- patch: <https://git.kernel.org/stable/c/5297f5ddffef47b94172ab0d3d62270002a3dcc1>
- patch: <https://git.kernel.org/stable/c/abb604a1a9c87255c7a6f3b784410a9707baf467>
- other: <https://git.kernel.org/stable/c/63126215de7beebb662fcef7c7558c795000c904>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-21732>

HTML: <https://flawdb.com/CVE-2025-21732> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-21732>
