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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-07-03T08:13:57.694Z
- **Modified:** 2026-10-15T22:18:26.750Z

## Who should check

- Anyone running Linux \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< e32bafd08ee35feacd47b05cc5bfe9cd9659cd25; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 9673ca00e6c5503069dc98780e2e89db0e663c16; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< e4cde54b46a87231c77256a633be1bef62687d69; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< b58a295d10065960bcb9d60cb8ca6ead9837cd27; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 9cbca30102028f9ad3d2098f935c4368f581fd07; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 74fd327767fb784c5875cf7c4ba1217f26020943; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 028363685bd0b7a19b4a820f82dd905b1dc83999
- Anyone running Linux 5.6

## 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.

## Affected and fixed versions

- Linux: \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< e32bafd08ee35feacd47b05cc5bfe9cd9659cd25; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 9673ca00e6c5503069dc98780e2e89db0e663c16; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< e4cde54b46a87231c77256a633be1bef62687d69; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< b58a295d10065960bcb9d60cb8ca6ead9837cd27; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 9cbca30102028f9ad3d2098f935c4368f581fd07; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 74fd327767fb784c5875cf7c4ba1217f26020943; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 028363685bd0b7a19b4a820f82dd905b1dc83999 (cvelist)
- Linux: 5.6 (cvelist)

## Mitigation

- Upgrade Linux to 028363685bd0b7a19b4a820f82dd905b1dc83999 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-38097. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38097.md
Affected: Linux >= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, < e32bafd08ee35feacd47b05cc5bfe9cd9659cd25; >= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, < 9673ca00e6c5503069dc98780e2e89db0e663c16; >= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, < e4cde54b46a87231c77256a633be1bef62687d69; >= e27cca96cd68fa2c6814c90…
Fixed in: Linux 9673ca00e6c5503069dc98780e2e89db0e663c16, Linux 9cbca30102028f9ad3d2098f935c4368f581fd07, Linux 74fd327767fb784c5875cf7c4ba1217f26020943, Linux 028363685bd0b7a19b4a820f82dd905b1dc83999

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-38097 being exploited?

There is no confirmed exploitation: CVE-2025-38097 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-38097?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38097?

Linux \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< e32bafd08ee35feacd47b05cc5bfe9cd9659cd25; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 9673ca00e6c5503069dc98780e2e89db0e663c16; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< e4cde54b46a87231c77256a633be1bef62687d69; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< b58a295d10065960bcb9d60cb8ca6ead9837cd27; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 9cbca30102028f9ad3d2098f935c4368f581fd07; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 74fd327767fb784c5875cf7c4ba1217f26020943; \>= e27cca96cd68fa2c6814c90f9a1cfd36bb68c593, \< 028363685bd0b7a19b4a820f82dd905b1dc83999; Linux 5.6.

### Is there a fix for CVE-2025-38097?

Yes. Fixed in Linux 9673ca00e6c5503069dc98780e2e89db0e663c16, Linux 9cbca30102028f9ad3d2098f935c4368f581fd07, Linux 74fd327767fb784c5875cf7c4ba1217f26020943, Linux 028363685bd0b7a19b4a820f82dd905b1dc83999. Upgrade Linux to 028363685bd0b7a19b4a820f82dd905b1dc83999 or later.

### How do I check if I'm affected by CVE-2025-38097?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <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>
- other: <https://git.kernel.org/stable/c/e32bafd08ee35feacd47b05cc5bfe9cd9659cd25>
- other: <https://git.kernel.org/stable/c/9673ca00e6c5503069dc98780e2e89db0e663c16>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-38097>

HTML: <https://flawdb.com/CVE-2025-38097> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-38097>
