# CVE-2025-38097: espintcp: remove encap socket caching to avoid reference leak

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 12% of CVEs (2026-12-01)
- Published: 2025-07-03T08:13:57.694Z
- Modified: 2026-10-15T22:18:26.750Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## Description

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

espintcp: remove encap socket caching to avoid reference leak

The current scheme for caching the encap socket can lead to reference
leaks when we try to delete the netns.

The reference chain is: xfrm_state -> enacp_sk -> netns

Since the encap socket is a userspace socket, it holds a reference on
the netns. If we delete the espintcp state (through flush or
individual delete) before removing the netns, the reference on the
socket is dropped and the netns is correctly deleted. Otherwise, the
netns may not be reachable anymore (if all processes within the ns
have terminated), so we cannot delete the xfrm state to drop its
reference on the socket.

This patch results in a small (~2% in my tests) performance
regression.

A GC-type mechanism could be added for the socket cache, to clear
references if the state hasn't been used "recently", but it's a lot
more complex than just not caching the socket.

(As written by CVE List.)

## Affected

- Linux Linux: from e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 before e32bafd08ee35feacd47b05cc5bfe9cd9659cd25; from e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 before 9673ca00e6c5503069dc98780e2e89db0e663c16; from e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 before e4cde54b46a87231c77256a633be1bef62687d69; from e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 before b58a295d10065960bcb9d60cb8ca6ead9837cd27; from e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 before 9cbca30102028f9ad3d2098f935c4368f581fd07; from e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 before 74fd327767fb784c5875cf7c4ba1217f26020943; from e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 before 028363685bd0b7a19b4a820f82dd905b1dc83999; 5.6 (not affected: before 5.6; from 5.10.270 up to 5.10.*; from 5.15.221 up to 5.15.*; from 6.1.141 up to 6.1.*; from 6.6.93 up to 6.6.*; from 6.12.31 up to 6.12.*; from 6.14.9 up to 6.14.*; from 6.15 up to *)
- linux linux_kernel: from 5.6 before 6.1.141; from 6.2 before 6.6.93; from 6.7 before 6.12.31; from 6.13 before 6.14.9; 6.15
- debian debian_linux: 11.0

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/e32bafd08ee35feacd47b05cc5bfe9cd9659cd25>
- <https://git.kernel.org/stable/c/9673ca00e6c5503069dc98780e2e89db0e663c16>
- <https://git.kernel.org/stable/c/e4cde54b46a87231c77256a633be1bef62687d69> (patch)
- <https://git.kernel.org/stable/c/b58a295d10065960bcb9d60cb8ca6ead9837cd27> (patch)
- <https://git.kernel.org/stable/c/9cbca30102028f9ad3d2098f935c4368f581fd07> (patch)
- <https://git.kernel.org/stable/c/74fd327767fb784c5875cf7c4ba1217f26020943> (patch)
- <https://git.kernel.org/stable/c/028363685bd0b7a19b4a820f82dd905b1dc83999> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2025-38097](https://www.cve.org/CVERecord?id=CVE-2025-38097), CVE Terms of Use, modified 2026-10-15
- NVD: [CVE-2025-38097](https://nvd.nist.gov/vuln/detail/CVE-2025-38097), Public domain, modified 2026-10-15

---

Page: https://cve.day/CVE-2025-38097 · Whole record: https://cve.day/CVE-2025-38097.json · Rebuilt by cve.day 2026-11-25T22:59:00.506Z
