CVE-2025-21864: tcp: drop secpath at the same time as we currently drop dst
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 xfrm6_tunnel_net_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 xfrm_state found on spi_byaddr 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
xfrm_state), which is still attached to an skb. This skb is not
leaked, it ends up on sk_receive_queue and then gets defer-free'd by
skb_attempt_defer_free.
The problem happens when we defer freeing an skb (push it on one CPU's
defer_list), and don't flush that list before the netns is deleted. In
that case, we still have a reference on the xfrm_state 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.
Security readout for executives and security teams
Plain-English summary
A Linux networking cleanup flaw can keep a security-policy object referenced after a network namespace is deleted. Testing triggered a kernel warning during TCP over IPv6 IPComp cleanup. The supplied scoring rates potential impact high, but the technical narrative demonstrates a lifecycle inconsistency rather than a confirmed confidentiality, integrity, or availability compromise.
Executive priority
Treat this as a high patch-verification priority for systems on the listed Linux releases, especially those allowing low-privileged local access or using the described networking paths. It is not an exploitation-driven emergency based on supplied evidence. Require asset owners to confirm vendor backports because upstream versions and distribution package versions may not align.
Technical view
During deferred freeing of a received TCP socket buffer, its secpath can retain a reference to an xfrm_state beyond network-namespace teardown. The fix drops the secpath when TCP already drops the destination, after relevant LSM hooks have run, while preserving the newly attached MPTCP extension. The issue was reproduced with TCP over IPComp6 and namespace deletion.
Likely exposure
The bundle lists Linux 5.19, 6.1.130, 6.6.80, 6.12.17, 6.13.5, and 6.14 as affected, but also contains ambiguous version and commit entries. Exposure is most plausible where TCP over IPv6 IPComp and network-namespace teardown occur. Exact distribution kernel exposure requires vendor backport confirmation.
Exploitation context
CISA KEV status is false, and no supplied source reports active exploitation. The CVSS vector indicates local, low-complexity, low-privilege, no-user-interaction conditions. However, the technical narrative documents a test-triggered warning and lingering reference; it does not establish a reliable exploitation path or explain the scored high confidentiality, integrity, and availability impacts.
Researcher notes
The narrative establishes an xfrm_state reference retained through skb secpath during deferred freeing and namespace teardown. It does not explain how confidentiality or integrity compromise occurs, nor how the assigned CWE-476 null-pointer category applies. The CVSS impact assumptions and exact affected-version boundaries therefore need independent validation.
Mitigation direction
Identify deployed kernels and exact distributor package builds; prioritize versions listed as affected in the CVE record.
Apply the vendor-supported kernel update containing the applicable stable fix, then reboot into that kernel.
Consult distribution or appliance advisories for backport status when package versions differ from upstream numbering.
Validation and detection
Confirm the running kernel, not merely the installed package, is the remediated build.
Verify the vendor changelog or source includes the applicable referenced stable-kernel fix.
Review kernel logs for xfrm6_tunnel_net_exit warnings associated with network-namespace deletion.
In a controlled environment, repeat relevant namespace cleanup tests and confirm the warning no longer occurs.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-476: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-476 · source CWE mapping
NULL Pointer Dereference
NULL Pointer Dereference represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.