CVE-2025-21864

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-21864
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-21864.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-21864
Downstream
Related
Published
2025-03-12T09:42:21.223Z
Modified
2025-11-28T02:34:56.085728Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
tcp: drop secpath at the same time as we currently drop dst
Details

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

tcp: drop secpath at the same time as we currently drop dst

Xiumei reported hitting the WARN in xfrm6tunnelnet_exit while running tests that boil down to: - create a pair of netns - run a basic TCP test over ipcomp6 - delete the pair of netns

The xfrmstate found on spibyaddr was not deleted at the time we delete the netns, because we still have a reference on it. This lingering reference comes from a secpath (which holds a ref on the xfrmstate), which is still attached to an skb. This skb is not leaked, it ends up on skreceivequeue and then gets defer-free'd by skbattemptdeferfree.

The problem happens when we defer freeing an skb (push it on one CPU's deferlist), and don't flush that list before the netns is deleted. In that case, we still have a reference on the xfrmstate that we don't expect at this point.

We already drop the skb's dst in the TCP receive path when it's no longer needed, so let's also drop the secpath. At this point, tcp_filter has already called into the LSM hooks that may require the secpath, so it should not be needed anymore. However, in some of those places, the MPTCP extension has just been attached to the skb, so we cannot simply drop all extensions.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21864.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
68822bdf76f10c3dc80609d4e2cdc1e847429086
Fixed
87858bbf21da239ace300d61dd209907995c0491
Fixed
f1d5e6a5e468308af7759cf5276779d3155c5e98
Fixed
cd34a07f744451e2ecf9005bb7d24d0b2fb83656
Fixed
69cafd9413084cd5012cf5d7c7ec6f3d493726d9
Fixed
9b6412e6979f6f9e0632075f8f008937b5cd4efd

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.19.0
Fixed
6.1.130
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.80
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.17
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.13.5