# CVE-2025-40238: net/mlx5: Fix IPsec cleanup over MPV device

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.27% (percentile 13, 2026-11-26)
- **Published:** 2025-12-04T15:31:28.243Z
- **Modified:** 2026-10-19T19:10:00.130Z

## Who should check

- Anyone running Linux \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 7e212cebc863c2c7a82f480446cd731721451691; \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 8956686d398eca6d324d2d164f9d2a281175a3a1; \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 664f76be38a18c61151d0ef248c7e2f3afb4f3c7
- Anyone running Linux 6.7

## Description

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

net/mlx5: Fix IPsec cleanup over MPV device

When we do mlx5e\_detach\_netdev() we eventually disable blocking events
notifier, among those events are IPsec MPV events from IB to core.

So before disabling those blocking events, make sure to also unregister
the devcom device and mark all this device operations as complete,
in order to prevent the other device from using invalid netdev
during future devcom events which could cause the trace below.

BUG: kernel NULL pointer dereference, address: 0000000000000010
PGD 146427067 P4D 146427067 PUD 146488067 PMD 0
Oops: Oops: 0000 \[\#1\] SMP
CPU: 1 UID: 0 PID: 7735 Comm: devlink Tainted: GW 6.12.0-rc6\_for\_upstream\_min\_debug\_2024\_11\_08\_00\_46 \#1
Tainted: \[W\]=WARN
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
RIP: 0010:mlx5\_devcom\_comp\_set\_ready+0x5/0x40 \[mlx5\_core\]
Code: 00 01 48 83 05 23 32 1e 00 01 41 b8 ed ff ff ff e9 60 ff ff ff 48 83 05 00 32 1e 00 01 eb e3 66 0f 1f 44 00 00 0f 1f 44 00 00 \<48\> 8b 47 10 48 83 05 5f 32 1e 00 01 48 8b 50 40 48 85 d2 74 05 40
RSP: 0018:ffff88811a5c35f8 EFLAGS: 00010206
RAX: ffff888106e8ab80 RBX: ffff888107d7e200 RCX: ffff88810d6f0a00
RDX: ffff88810d6f0a00 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffff88811a17e620 R08: 0000000000000040 R09: 0000000000000000
R10: ffff88811a5c3618 R11: 0000000de85d51bd R12: ffff88811a17e600
R13: ffff88810d6f0a00 R14: 0000000000000000 R15: ffff8881034bda80
FS:  00007f27bdf89180(0000) GS:ffff88852c880000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000010 CR3: 000000010f159005 CR4: 0000000000372eb0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 \<TASK\>
 ? \_\_die+0x20/0x60
 ? page\_fault\_oops+0x150/0x3e0
 ? exc\_page\_fault+0x74/0x130
 ? asm\_exc\_page\_fault+0x22/0x30
 ? mlx5\_devcom\_comp\_set\_ready+0x5/0x40 \[mlx5\_core\]
 mlx5e\_devcom\_event\_mpv+0x42/0x60 \[mlx5\_core\]
 mlx5\_devcom\_send\_event+0x8c/0x170 \[mlx5\_core\]
 blocking\_event+0x17b/0x230 \[mlx5\_core\]
 notifier\_call\_chain+0x35/0xa0
 blocking\_notifier\_call\_chain+0x3d/0x60
 mlx5\_blocking\_notifier\_call\_chain+0x22/0x30 \[mlx5\_core\]
 mlx5\_core\_mp\_event\_replay+0x12/0x20 \[mlx5\_core\]
 mlx5\_ib\_bind\_slave\_port+0x228/0x2c0 \[mlx5\_ib\]
 mlx5\_ib\_stage\_init\_init+0x664/0x9d0 \[mlx5\_ib\]
 ? idr\_alloc\_cyclic+0x50/0xb0
 ? \_\_kmalloc\_cache\_noprof+0x167/0x340
 ? \_\_kmalloc\_noprof+0x1a7/0x430
 \_\_mlx5\_ib\_add+0x34/0xd0 \[mlx5\_ib\]
 mlx5r\_probe+0xe9/0x310 \[mlx5\_ib\]
 ? kernfs\_add\_one+0x107/0x150
 ? \_\_mlx5\_ib\_add+0xd0/0xd0 \[mlx5\_ib\]
 auxiliary\_bus\_probe+0x3e/0x90
 really\_probe+0xc5/0x3a0
 ? driver\_probe\_device+0x90/0x90
 \_\_driver\_probe\_device+0x80/0x160
 driver\_probe\_device+0x1e/0x90
 \_\_device\_attach\_driver+0x7d/0x100
 bus\_for\_each\_drv+0x80/0xd0
 \_\_device\_attach+0xbc/0x1f0
 bus\_probe\_device+0x86/0xa0
 device\_add+0x62d/0x830
 \_\_auxiliary\_device\_add+0x3b/0xa0
 ? auxiliary\_device\_init+0x41/0x90
 add\_adev+0xd1/0x150 \[mlx5\_core\]
 mlx5\_rescan\_drivers\_locked+0x21c/0x300 \[mlx5\_core\]
 esw\_mode\_change+0x6c/0xc0 \[mlx5\_core\]
 mlx5\_devlink\_eswitch\_mode\_set+0x21e/0x640 \[mlx5\_core\]
 devlink\_nl\_eswitch\_set\_doit+0x60/0xe0
 genl\_family\_rcv\_msg\_doit+0xd0/0x120
 genl\_rcv\_msg+0x180/0x2b0
 ? devlink\_get\_from\_attrs\_lock+0x170/0x170
 ? devlink\_nl\_eswitch\_get\_doit+0x290/0x290
 ? devlink\_nl\_pre\_doit\_port\_optional+0x50/0x50
 ? genl\_family\_rcv\_msg\_dumpit+0xf0/0xf0
 netlink\_rcv\_skb+0x54/0x100
 genl\_rcv+0x24/0x40
 netlink\_unicast+0x1fc/0x2d0
 netlink\_sendmsg+0x1e4/0x410
 \_\_sock\_sendmsg+0x38/0x60
 ? sockfd\_lookup\_light+0x12/0x60
 \_\_sys\_sendto+0x105/0x160
 ? \_\_sys\_recvmsg+0x4e/0x90
 \_\_x64\_sys\_sendto+0x20/0x30
 do\_syscall\_64+0x4c/0x100
 entry\_SYSCALL\_64\_after\_hwframe+0x4b/0x53
RIP: 0033:0x7f27bc91b13a
Code: bb 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 8b 05 fa 96 2c 00 45 89 c9 4c 63 d1 48 63 ff 85 c0 75 15 b8 2c 00 00 00 0f 05 \<48\> 3d 00 f0 ff ff 
---truncated---

## Affected and fixed versions

- Linux: \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 7e212cebc863c2c7a82f480446cd731721451691; \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 8956686d398eca6d324d2d164f9d2a281175a3a1; \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 664f76be38a18c61151d0ef248c7e2f3afb4f3c7 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

- Upgrade Linux to 664f76be38a18c61151d0ef248c7e2f3afb4f3c7 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-40238.md
Affected: Linux >= 82f9378c443c206d3f9e45844306e5270e7e4109, < 7e212cebc863c2c7a82f480446cd731721451691; >= 82f9378c443c206d3f9e45844306e5270e7e4109, < 8956686d398eca6d324d2d164f9d2a281175a3a1; >= 82f9378c443c206d3f9e45844306e5270e7e4109, < 664f76be38a18c61151d0ef248c7e2f3afb4f3c7; Linux 6.7
Fixed in: Linux 7e212cebc863c2c7a82f480446cd731721451691, Linux 8956686d398eca6d324d2d164f9d2a281175a3a1, Linux 664f76be38a18c61151d0ef248c7e2f3afb4f3c7

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-40238 being exploited?

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 7e212cebc863c2c7a82f480446cd731721451691; \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 8956686d398eca6d324d2d164f9d2a281175a3a1; \>= 82f9378c443c206d3f9e45844306e5270e7e4109, \< 664f76be38a18c61151d0ef248c7e2f3afb4f3c7; Linux 6.7.

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

Yes. Fixed in Linux 7e212cebc863c2c7a82f480446cd731721451691, Linux 8956686d398eca6d324d2d164f9d2a281175a3a1, Linux 664f76be38a18c61151d0ef248c7e2f3afb4f3c7. Upgrade Linux to 664f76be38a18c61151d0ef248c7e2f3afb4f3c7 or later.

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

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

- other: <https://git.kernel.org/stable/c/7e212cebc863c2c7a82f480446cd731721451691>
- other: <https://git.kernel.org/stable/c/8956686d398eca6d324d2d164f9d2a281175a3a1>
- other: <https://git.kernel.org/stable/c/664f76be38a18c61151d0ef248c7e2f3afb4f3c7>

## 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-40238>

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