# CVE-2025-40215: xfrm: delete x-\>tunnel as we delete x

> 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.23% (percentile 9, 2026-11-28)
- **Published:** 2025-12-04T12:38:32.517Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 1b28a7fae0128fa140a7dccd995182ff6cd1c67b; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 4b2c17d0f9be8b58bb30468bc81a4b61c985b04e; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 0da961fa46da1b37ef868d9b603bd202136f8f8e; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< d0e0d1097118461463b76562c7ebaabaa5b90b13; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< dc3636912d41770466543623cb76e7b88fdb42c7; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< b441cf3f8c4b8576639d20c8eb4aa32917602ecd
- Anyone running Linux 2.6.29

## Description

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

xfrm: delete x-\>tunnel as we delete x

The ipcomp fallback tunnels currently get deleted (from the various
lists and hashtables) as the last user state that needed that fallback
is destroyed (not deleted). If a reference to that user state still
exists, the fallback state will remain on the hashtables/lists,
triggering the WARN in xfrm\_state\_fini. Because of those remaining
references, the fix in commit f75a2804da39 ("xfrm: destroy xfrm\_state
synchronously on net exit path") is not complete.

We recently fixed one such situation in TCP due to defered freeing of
skbs (commit 9b6412e6979f ("tcp: drop secpath at the same time as we
currently drop dst")). This can also happen due to IP reassembly: skbs
with a secpath remain on the reassembly queue until netns
destruction. If we can't guarantee that the queues are flushed by the
time xfrm\_state\_fini runs, there may still be references to a (user)
xfrm\_state, preventing the timely deletion of the corresponding
fallback state.

Instead of chasing each instance of skbs holding a secpath one by one,
this patch fixes the issue directly within xfrm, by deleting the
fallback state as soon as the last user state depending on it has been
deleted. Destruction will still happen when the final reference is
dropped.

A separate lockdep class for the fallback state is required since
we're going to lock x-\>tunnel while x is locked.

## Affected and fixed versions

- Linux: \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 1b28a7fae0128fa140a7dccd995182ff6cd1c67b; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 4b2c17d0f9be8b58bb30468bc81a4b61c985b04e; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 0da961fa46da1b37ef868d9b603bd202136f8f8e; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< d0e0d1097118461463b76562c7ebaabaa5b90b13; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< dc3636912d41770466543623cb76e7b88fdb42c7; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< b441cf3f8c4b8576639d20c8eb4aa32917602ecd (cvelist)
- Linux: 2.6.29 (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-40215. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40215.md
Affected: Linux >= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, < 1b28a7fae0128fa140a7dccd995182ff6cd1c67b; >= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, < 4b2c17d0f9be8b58bb30468bc81a4b61c985b04e; >= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, < 0da961fa46da1b37ef868d9b603bd202136f8f8e; >= 9d4139c76905833afcb77fe…
Fixed in: Linux 1b28a7fae0128fa140a7dccd995182ff6cd1c67b, Linux 4b2c17d0f9be8b58bb30468bc81a4b61c985b04e, Linux 0da961fa46da1b37ef868d9b603bd202136f8f8e

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

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

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

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

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

Linux \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 1b28a7fae0128fa140a7dccd995182ff6cd1c67b; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 4b2c17d0f9be8b58bb30468bc81a4b61c985b04e; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< 0da961fa46da1b37ef868d9b603bd202136f8f8e; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< d0e0d1097118461463b76562c7ebaabaa5b90b13; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< dc3636912d41770466543623cb76e7b88fdb42c7; \>= 9d4139c76905833afcb77fe8ccc17f302a0eb9ab, \< b441cf3f8c4b8576639d20c8eb4aa32917602ecd; Linux 2.6.29.

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

Yes. Fixed in Linux 1b28a7fae0128fa140a7dccd995182ff6cd1c67b, Linux 4b2c17d0f9be8b58bb30468bc81a4b61c985b04e, Linux 0da961fa46da1b37ef868d9b603bd202136f8f8e. No fix listed yet: follow the vendor advisory.

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

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/1b28a7fae0128fa140a7dccd995182ff6cd1c67b>
- other: <https://git.kernel.org/stable/c/4b2c17d0f9be8b58bb30468bc81a4b61c985b04e>
- other: <https://git.kernel.org/stable/c/0da961fa46da1b37ef868d9b603bd202136f8f8e>
- other: <https://git.kernel.org/stable/c/d0e0d1097118461463b76562c7ebaabaa5b90b13>
- other: <https://git.kernel.org/stable/c/dc3636912d41770466543623cb76e7b88fdb42c7>
- other: <https://git.kernel.org/stable/c/b441cf3f8c4b8576639d20c8eb4aa32917602ecd>

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

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