CVE-2025-40256 json
xfrm: also call xfrm_state_delete_tunnel at destroy time for states that were never added
published 2025-12-04 11 mo ago modified 2026-10-19 20 d ago also EUVD-2025-201201
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 12%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
xfrm: also call xfrm_state_delete_tunnel at destroy time for states that were never added
In commit b441cf3f8c4b ("xfrm: delete x->tunnel as we delete x"), I missed the case where state creation fails between full initialization (->init_state has been called) and being inserted on the lists.
In this situation, ->init_state has been called, so for IPcomp tunnels, the fallback tunnel has been created and added onto the lists, but the user state never gets added, because we fail before that. The user state doesn't go through __xfrm_state_delete, so we don't call xfrm_state_delete_tunnel for those states, and we end up leaking the FB tunnel.
There are several codepaths affected by this: the add/update paths, in both net/key and xfrm, and the migrate code (xfrm_migrate, xfrm_state_migrate). A "proper" rollback of the init_state work would probably be doable in the add/update code, but for migrate it gets more complicated as multiple states may be involved.
At some point, the new (not-inserted) state will be destroyed, so call xfrm_state_delete_tunnel during xfrm_state_gc_destroy. Most states will have their fallback tunnel cleaned up during __xfrm_state_delete, which solves the issue that b441cf3f8c4b (and other patches before it) aimed at. All states (including FB tunnels) will be removed from the lists once xfrm_state_fini has called flush_work(&xfrm_state_gc_work).
Patch / fix
- Linux Linux 6.17.10, 6.18
- linux Debian 14 6.17.10-1
debian advisories DEBIAN-CVE-2025-40256
- linux Ubuntu 25.10 6.17.0-14.14
- linux-aws Ubuntu 25.10 6.17.0-1007.7
- linux-gcp Ubuntu 25.10 6.17.0-1007.7
- linux-azure Ubuntu 25.10 6.17.0-1008.8
- linux-raspi Ubuntu 25.10 6.17.0-1008.8
- linux-riscv Ubuntu 25.10 6.17.0-14.14.1
- linux-oracle Ubuntu 25.10 6.17.0-1007.7
- linux-aws-6.17 Ubuntu 24.04 LTS 6.17.0-1007.7~24.04.1
ubuntu advisories UBUNTU-CVE-2025-40256
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-40.1
- kernel-source-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-40.1
- kernel-64kb SLES 15 SP4-LTSS, SLE High Performance Computing 15 SP4-LTSS, SLE High Performance Computing 15 SP4-ESPOS 5.14.21-150400.24.194.1
- kernel-syms SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE High Performance Computing 15 SP4-LTSS +1 more 5.14.21-150400.24.194.1
- kernel-source SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE High Performance Computing 15 SP4-LTSS +1 more 5.14.21-150400.24.194.1
- kernel-default SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE Micro 5.4 +5 more 5.14.21-150400.24.194.1
- kernel-obs-build SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE High Performance Computing 15 SP4-LTSS +1 more 5.14.21-150400.24.194.1
- kernel-default-base SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE Micro 5.4 +3 more 5.14.21-150400.24.194.1.150400.24.98.3
suse advisories SUSE-SU-2026:20845-1SUSE-SU-2026:20876-1SUSE-SU-2026:0617-1SUSE-SU-2026:20477-1SUSE-SU-2026:20498-1SUSE-SU-2026:0411-1
- kernel-rt openSUSE Leap 16.0 6.12.0-160000.9.1
- dtb-aarch64 openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-64kb openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-syms openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-azure openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-obs-qa openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-source openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-default openSUSE Leap 16.0 6.12.0-160000.9.1
opensuse advisories openSUSE-SU-2026:20145-1
- git.kernel.org/stable/c/57b72d74d4651dc19d046308a8304eb9abfe66ac commit
- git.kernel.org/stable/c/1dad653643f28ccc89be93f9440b8804cded85b2 commit
- git.kernel.org/stable/c/64441724387b4ac92f67ef51caaaeffe99c950d1 commit
- git.kernel.org/stable/c/763e5c351206c1e4d910db4a1159053f6263689c commit
- git.kernel.org/stable/c/f7d879c19d306512c2e260f37e8a3e5c85e37c50 commit
- git.kernel.org/stable/c/d6fe5c740c573af10943b8353992e1325cdb2715 commit
- git.kernel.org/stable/c/10deb69864840ccf96b00ac2ab3a2055c0c04721 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-40256 updated cvss 7.1
kernel: xfrm: also call xfrm_state_delete_tunnel at destroy time for states that were never added
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more Red Hat Enterprise Linux 10 kernelnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
0.22% chance of exploitation in the next 30 days, higher than 12% of all scored CVEs (FIRST EPSS, 2026-11-08).
Affected products
- Linux Linux
Classification
- Technology feeds
References
- git.kernel.org /stable/c/57b72d74d4651dc19d046308a8304eb9abfe66ac
- git.kernel.org /stable/c/1dad653643f28ccc89be93f9440b8804cded85b2
- git.kernel.org /stable/c/64441724387b4ac92f67ef51caaaeffe99c950d1
- git.kernel.org /stable/c/763e5c351206c1e4d910db4a1159053f6263689c
- git.kernel.org /stable/c/f7d879c19d306512c2e260f37e8a3e5c85e37c50
- git.kernel.org /stable/c/d6fe5c740c573af10943b8353992e1325cdb2715
- git.kernel.org /stable/c/10deb69864840ccf96b00ac2ab3a2055c0c04721
Sources
- CVE List CVE-2025-40256
- NVD CVE-2025-40256
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.