# CVE-2025-38500: xfrm: interface: fix use-after-free after changing collect\_md xfrm interface

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-08-12T16:02:42.363Z
- **Modified:** 2026-08-05T12:02:27.344Z

## Who should check

- Anyone running Linux \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< a8d4748b954584ab7bd800f1a4e46d5b0eeb5ce4; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< bfebdb85496e1da21d3cf05de099210915c3e706; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< 5918c3f4800a3aef2173865e5903370f21e24f47; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< 69a31f7a6a81f5ffd3812c442e09ff0be22960f1; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< a90b2a1aaacbcf0f91d7e4868ad6c51c5dee814b
- Anyone running Linux 6.1

## Description

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

xfrm: interface: fix use-after-free after changing collect\_md xfrm interface

collect\_md property on xfrm interfaces can only be set on device creation,
thus xfrmi\_changelink() should fail when called on such interfaces.

The check to enforce this was done only in the case where the xi was
returned from xfrmi\_locate() which doesn't look for the collect\_md
interface, and thus the validation was never reached.

Calling changelink would thus errornously place the special interface xi
in the xfrmi\_net-\>xfrmi hash, but since it also exists in the
xfrmi\_net-\>collect\_md\_xfrmi pointer it would lead to a double free when
the net namespace was taken down \[1\].

Change the check to use the xi from netdev\_priv which is available earlier
in the function to prevent changes in xfrm collect\_md interfaces.

\[1\] resulting oops:
\[    8.516540\] kernel BUG at net/core/dev.c:12029!
\[    8.516552\] Oops: invalid opcode: 0000 \[\#1\] SMP NOPTI
\[    8.516559\] CPU: 0 UID: 0 PID: 12 Comm: kworker/u80:0 Not tainted 6.15.0-virtme \#5 PREEMPT(voluntary)
\[    8.516565\] Hardware name: QEMU Ubuntu 24.04 PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
\[    8.516569\] Workqueue: netns cleanup\_net
\[    8.516579\] RIP: 0010:unregister\_netdevice\_many\_notify+0x101/0xab0
\[    8.516590\] Code: 90 0f 0b 90 48 8b b0 78 01 00 00 48 8b 90 80 01 00 00 48 89 56 08 48 89 32 4c 89 80 78 01 00 00 48 89 b8 80 01 00 00 eb ac 90 \<0f\> 0b 48 8b 45 00 4c 8d a0 88 fe ff ff 48 39 c5 74 5c 41 80 bc 24
\[    8.516593\] RSP: 0018:ffffa93b8006bd30 EFLAGS: 00010206
\[    8.516598\] RAX: ffff98fe4226e000 RBX: ffffa93b8006bd58 RCX: ffffa93b8006bc60
\[    8.516601\] RDX: 0000000000000004 RSI: 0000000000000000 RDI: dead000000000122
\[    8.516603\] RBP: ffffa93b8006bdd8 R08: dead000000000100 R09: ffff98fe4133c100
\[    8.516605\] R10: 0000000000000000 R11: 00000000000003d2 R12: ffffa93b8006be00
\[    8.516608\] R13: ffffffff96c1a510 R14: ffffffff96c1a510 R15: ffffa93b8006be00
\[    8.516615\] FS:  0000000000000000(0000) GS:ffff98fee73b7000(0000) knlGS:0000000000000000
\[    8.516619\] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
\[    8.516622\] CR2: 00007fcd2abd0700 CR3: 000000003aa40000 CR4: 0000000000752ef0
\[    8.516625\] PKRU: 55555554
\[    8.516627\] Call Trace:
\[    8.516632\]  \<TASK\>
\[    8.516635\]  ? rtnl\_is\_locked+0x15/0x20
\[    8.516641\]  ? unregister\_netdevice\_queue+0x29/0xf0
\[    8.516650\]  ops\_undo\_list+0x1f2/0x220
\[    8.516659\]  cleanup\_net+0x1ad/0x2e0
\[    8.516664\]  process\_one\_work+0x160/0x380
\[    8.516673\]  worker\_thread+0x2aa/0x3c0
\[    8.516679\]  ? \_\_pfx\_worker\_thread+0x10/0x10
\[    8.516686\]  kthread+0xfb/0x200
\[    8.516690\]  ? \_\_pfx\_kthread+0x10/0x10
\[    8.516693\]  ? \_\_pfx\_kthread+0x10/0x10
\[    8.516697\]  ret\_from\_fork+0x82/0xf0
\[    8.516705\]  ? \_\_pfx\_kthread+0x10/0x10
\[    8.516709\]  ret\_from\_fork\_asm+0x1a/0x30
\[    8.516718\]  \</TASK\>

## Affected and fixed versions

- Linux: \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< a8d4748b954584ab7bd800f1a4e46d5b0eeb5ce4; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< bfebdb85496e1da21d3cf05de099210915c3e706; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< 5918c3f4800a3aef2173865e5903370f21e24f47; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< 69a31f7a6a81f5ffd3812c442e09ff0be22960f1; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< a90b2a1aaacbcf0f91d7e4868ad6c51c5dee814b (cvelist)
- Linux: 6.1 (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-38500. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38500.md
Affected: Linux >= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, < a8d4748b954584ab7bd800f1a4e46d5b0eeb5ce4; >= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, < bfebdb85496e1da21d3cf05de099210915c3e706; >= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, < 5918c3f4800a3aef2173865e5903370f21e24f47; >= abc340b38ba25cd6c7aa2c0…
Fixed in: Linux 5918c3f4800a3aef2173865e5903370f21e24f47, Linux 69a31f7a6a81f5ffd3812c442e09ff0be22960f1

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

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< a8d4748b954584ab7bd800f1a4e46d5b0eeb5ce4; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< bfebdb85496e1da21d3cf05de099210915c3e706; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< 5918c3f4800a3aef2173865e5903370f21e24f47; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< 69a31f7a6a81f5ffd3812c442e09ff0be22960f1; \>= abc340b38ba25cd6c7aa2c0bd9150d30738c82d0, \< a90b2a1aaacbcf0f91d7e4868ad6c51c5dee814b; Linux 6.1.

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

Yes. Fixed in Linux 5918c3f4800a3aef2173865e5903370f21e24f47, Linux 69a31f7a6a81f5ffd3812c442e09ff0be22960f1. No fix listed yet: follow the vendor advisory.

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

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/a8d4748b954584ab7bd800f1a4e46d5b0eeb5ce4>
- patch: <https://git.kernel.org/stable/c/bfebdb85496e1da21d3cf05de099210915c3e706>
- patch: <https://git.kernel.org/stable/c/5918c3f4800a3aef2173865e5903370f21e24f47>
- patch: <https://git.kernel.org/stable/c/69a31f7a6a81f5ffd3812c442e09ff0be22960f1>
- patch: <https://git.kernel.org/stable/c/a90b2a1aaacbcf0f91d7e4868ad6c51c5dee814b>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>

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

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