CVE-2025-21864
Severity CVSS v4.0:
Pending analysis
Type:
CWE-476
NULL Pointer Dereference
Publication date:
12/03/2025
Last modified:
13/03/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
tcp: drop secpath at the same time as we currently drop dst<br />
<br />
Xiumei reported hitting the WARN in xfrm6_tunnel_net_exit while<br />
running tests that boil down to:<br />
- create a pair of netns<br />
- run a basic TCP test over ipcomp6<br />
- delete the pair of netns<br />
<br />
The xfrm_state found on spi_byaddr was not deleted at the time we<br />
delete the netns, because we still have a reference on it. This<br />
lingering reference comes from a secpath (which holds a ref on the<br />
xfrm_state), which is still attached to an skb. This skb is not<br />
leaked, it ends up on sk_receive_queue and then gets defer-free&#39;d by<br />
skb_attempt_defer_free.<br />
<br />
The problem happens when we defer freeing an skb (push it on one CPU&#39;s<br />
defer_list), and don&#39;t flush that list before the netns is deleted. In<br />
that case, we still have a reference on the xfrm_state that we don&#39;t<br />
expect at this point.<br />
<br />
We already drop the skb&#39;s dst in the TCP receive path when it&#39;s no<br />
longer needed, so let&#39;s also drop the secpath. At this point,<br />
tcp_filter has already called into the LSM hooks that may require the<br />
secpath, so it should not be needed anymore. However, in some of those<br />
places, the MPTCP extension has just been attached to the skb, so we<br />
cannot simply drop all extensions.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
CPE | From | Up to |
---|---|---|
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.19 (including) | 6.1.130 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.80 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.12.17 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.13 (including) | 6.13.5 (excluding) |
cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:* | ||
cpe:2.3:o:linux:linux_kernel:6.14:rc2:*:*:*:*:*:* | ||
cpe:2.3:o:linux:linux_kernel:6.14:rc3:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/69cafd9413084cd5012cf5d7c7ec6f3d493726d9
- https://git.kernel.org/stable/c/87858bbf21da239ace300d61dd209907995c0491
- https://git.kernel.org/stable/c/9b6412e6979f6f9e0632075f8f008937b5cd4efd
- https://git.kernel.org/stable/c/cd34a07f744451e2ecf9005bb7d24d0b2fb83656
- https://git.kernel.org/stable/c/f1d5e6a5e468308af7759cf5276779d3155c5e98