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

- Priority: **Routine**
- Reason: Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-12-04 · Modified: 2026-08-05
- Aliases: UBUNTU-CVE-2025-40215, DEBIAN-CVE-2025-40215
- Record: https://cvemate.com/vulnerability/CVE-2025-40215 · JSON: https://cvemate.com/vulnerability/CVE-2025-40215/json

## Description

```text
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.
```

## Signals

- CVSS: 7.8 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.154%, percentile 4.754%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 150)

- debian linux (Debian): \< 6.1.162-1 \| \< 6.12.63-1 \| \< 6.16.3-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 4.4.0-278.312 \| \< 4.15.0-247.259 \| \< 5.4.0-227.247 \| \< 5.15.0-170.180 \| \< 6.8.0-100.100
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 4.4.0-1152.158 \| \< 4.4.0-1190.205 \| \< 4.15.0-1189.202 \| \< 5.4.0-1156.166 \| \< 5.15.0-1100.107 \| \< 6.8.0-1046.49
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1100.107~20.04.2
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1156.166~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.14 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1046.49~22.04.1
- ubuntu linux-aws-fips (Ubuntu): \< 4.15.0-2127.133 \| All versions (No fix recorded) \| \< 5.4.0-1155.165+fips1 \| \< 5.15.0-1100.107+fips1 \| \< 6.8.0-1046.49+fips1
- ubuntu linux-aws-hwe (Ubuntu): \< 4.15.0-1189.202~16.04.1
- ubuntu linux-azure (Ubuntu): \< 4.15.0-1197.212~14.04.1 \| \< 4.15.0-1197.212~16.04.1 \| All versions (No fix recorded) \| \< 5.4.0-1160.166 \| \< 5.15.0-1109.118 \| \< 6.8.0-1046.52
- ubuntu linux-azure-4.15 (Ubuntu): \< 4.15.0-1197.212

## References (first 20 of 62)

- <https://git.kernel.org/stable/c/1b28a7fae0128fa140a7dccd995182ff6cd1c67b>
- <https://git.kernel.org/stable/c/4b2c17d0f9be8b58bb30468bc81a4b61c985b04e>
- <https://git.kernel.org/stable/c/0da961fa46da1b37ef868d9b603bd202136f8f8e>
- <https://git.kernel.org/stable/c/d0e0d1097118461463b76562c7ebaabaa5b90b13>
- <https://git.kernel.org/stable/c/dc3636912d41770466543623cb76e7b88fdb42c7>
- <https://git.kernel.org/stable/c/b441cf3f8c4b8576639d20c8eb4aa32917602ecd>
- <https://ubuntu.com/security/CVE-2025-40215>
- <https://www.cve.org/CVERecord?id=CVE-2025-40215>
- <https://git.kernel.org/linus/b441cf3f8c4b8576639d20c8eb4aa32917602ecd>
- <https://ubuntu.com/security/notices/USN-8028-1>
- <https://ubuntu.com/security/notices/USN-8028-2>
- <https://ubuntu.com/security/notices/USN-8031-1>
- <https://ubuntu.com/security/notices/USN-8033-1>
- <https://ubuntu.com/security/notices/USN-8033-2>
- <https://ubuntu.com/security/notices/USN-8033-3>
- <https://ubuntu.com/security/notices/USN-8034-1>
- <https://ubuntu.com/security/notices/USN-8033-4>
- <https://ubuntu.com/security/notices/USN-8028-3>
- <https://ubuntu.com/security/notices/USN-8028-4>
- <https://ubuntu.com/security/notices/USN-8033-5>

---

Data as of 2026-12-05T04:44:46.958Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
