CVE-2025-38097 (GCVE-0-2025-38097)

Vulnerability from cvelistv5 – Published: 2025-07-03 08:13 – Updated: 2026-10-15 21:52
VLAI
Title
espintcp: remove encap socket caching to avoid reference leak
Summary
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.
SSVC
Exploitation: none Automatable: no Technical Impact: total
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2026-10-15 21:47 UTC
Assigner
Linux CNA
Impacted products
Vendor Product Version
Linux Linux Affected: e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 , < e32bafd08ee35feacd47b05cc5bfe9cd9659cd25 (git)
Affected: e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 , < 9673ca00e6c5503069dc98780e2e89db0e663c16 (git)
Affected: e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 , < e4cde54b46a87231c77256a633be1bef62687d69 (git)
Affected: e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 , < b58a295d10065960bcb9d60cb8ca6ead9837cd27 (git)
Affected: e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 , < 9cbca30102028f9ad3d2098f935c4368f581fd07 (git)
Affected: e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 , < 74fd327767fb784c5875cf7c4ba1217f26020943 (git)
Affected: e27cca96cd68fa2c6814c90f9a1cfd36bb68c593 , < 028363685bd0b7a19b4a820f82dd905b1dc83999 (git)
Create a notification for this product.
Linux Linux Affected: 5.6
Unaffected: 0 , < 5.6 (semver)
Unaffected: 5.10.270 , ≤ 5.10.* (semver)
Unaffected: 5.15.221 , ≤ 5.15.* (semver)
Unaffected: 6.1.141 , ≤ 6.1.* (semver)
Unaffected: 6.6.93 , ≤ 6.6.* (semver)
Unaffected: 6.12.31 , ≤ 6.12.* (semver)
Unaffected: 6.14.9 , ≤ 6.14.* (semver)
Unaffected: 6.15 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2025-11-03T17:34:02.117Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2025-38097",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2026-10-15T21:47:21.694402Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2026-10-15T21:52:08.064Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "include/net/xfrm.h",
            "net/ipv4/esp4.c",
            "net/ipv6/esp6.c",
            "net/xfrm/xfrm_state.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "e32bafd08ee35feacd47b05cc5bfe9cd9659cd25",
              "status": "affected",
              "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
              "versionType": "git"
            },
            {
              "lessThan": "9673ca00e6c5503069dc98780e2e89db0e663c16",
              "status": "affected",
              "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
              "versionType": "git"
            },
            {
              "lessThan": "e4cde54b46a87231c77256a633be1bef62687d69",
              "status": "affected",
              "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
              "versionType": "git"
            },
            {
              "lessThan": "b58a295d10065960bcb9d60cb8ca6ead9837cd27",
              "status": "affected",
              "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
              "versionType": "git"
            },
            {
              "lessThan": "9cbca30102028f9ad3d2098f935c4368f581fd07",
              "status": "affected",
              "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
              "versionType": "git"
            },
            {
              "lessThan": "74fd327767fb784c5875cf7c4ba1217f26020943",
              "status": "affected",
              "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
              "versionType": "git"
            },
            {
              "lessThan": "028363685bd0b7a19b4a820f82dd905b1dc83999",
              "status": "affected",
              "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "include/net/xfrm.h",
            "net/ipv4/esp4.c",
            "net/ipv6/esp6.c",
            "net/xfrm/xfrm_state.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.6"
            },
            {
              "lessThan": "5.6",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.270",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.221",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.141",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.93",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.31",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.14.*",
              "status": "unaffected",
              "version": "6.14.9",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.15",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.270",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.221",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.141",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.93",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.31",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.14.9",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nespintcp: remove encap socket caching to avoid reference leak\n\nThe current scheme for caching the encap socket can lead to reference\nleaks when we try to delete the netns.\n\nThe reference chain is: xfrm_state -\u003e enacp_sk -\u003e netns\n\nSince the encap socket is a userspace socket, it holds a reference on\nthe netns. If we delete the espintcp state (through flush or\nindividual delete) before removing the netns, the reference on the\nsocket is dropped and the netns is correctly deleted. Otherwise, the\nnetns may not be reachable anymore (if all processes within the ns\nhave terminated), so we cannot delete the xfrm state to drop its\nreference on the socket.\n\nThis patch results in a small (~2% in my tests) performance\nregression.\n\nA GC-type mechanism could be added for the socket cache, to clear\nreferences if the state hasn\u0027t been used \"recently\", but it\u0027s a lot\nmore complex than just not caching the socket."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The entire attack is driven through local syscalls \u2014 `socket()`+`setsockopt(TCP_ULP,\"espintcp\")` to create the encap socket, NETLINK_XFRM to add/flush the SA and policy, and local traffic to trigger `esp_output_tail_tcp()`. No remote peer input is needed to populate or tear down the cached socket reference.\nAC:L - The reference leak itself is fully deterministic \u2014 create the SA, send one packet, let the namespace go away \u2014 with no race or memory-layout dependency, and `CONFIG_INET_ESPINTCP`/`CONFIG_INET6_ESPINTCP` are enabled in mainstream distro kernels. For the dangling-`encap_sk` window the attacker drives both sides (a traffic generator feeding `xfrm_trans_queue_net()` and a concurrent `xfrm state flush` loop) and can retry indefinitely.\nPR:L - Adding the xfrm state requires CAP_NET_ADMIN, but `xfrm_user.c` uses `netlink_net_capable()`, which resolves against `sock_net(skb-\u003esk)-\u003euser_ns`, so an ordinary unprivileged user obtains it with `unshare -Urn`; attaching the espintcp ULP requires no privilege at all. No real root in the init namespace is needed.\nUI:N - The attacker performs every step \u2014 socket setup, SA installation, packet transmission, and namespace teardown \u2014 entirely on their own. No victim action or cooperating process is involved.\nS:U - The leaked netns/socket and the dangling socket dereference are all kernel objects under the same security authority as the attacking context; no VM, IOMMU, or hypervisor boundary is crossed.\nC:H - After `__xfrm_state_delete()` drops the socket reference without RCU synchronization and leaves `x-\u003eencap_sk` non-NULL, the deferred `esp_find_tcp_sk()` reads `sk-\u003esk_state` and then operates on that released socket; because TCP sockets come from a SLAB_TYPESAFE_BY_RCU cache the slot can already hold an attacker-groomed socket, and `espintcp_getctx()` then follows a foreign `icsk_ulp_data`, giving a use-after-free read primitive over attacker-influenced kernel memory.\nI:H - The stale `x-\u003eencap_sk` also lets the slow path match `sk == nsk` and queue a second `sock_put()` through `call_rcu(esp_free_tcp_sk)`, a refcount underflow that frees a socket userspace still references by fd \u2014 a classic UAF write/heap-grooming primitive, and `bh_lock_sock()`/`espintcp_push_skb()` write into the freed object directly.\nA:H - Each leaked SA permanently pins an entire `struct net` (with all per-net subsystem allocations, sysctls, procfs entries and per-cpu data) that can never be reclaimed, and an unprivileged user can repeat this in a loop until kernel memory is exhausted or netns ucount limits break container creation; the dangling-socket dereference additionally oopses the kernel."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-09-14T11:58:01.146Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/e32bafd08ee35feacd47b05cc5bfe9cd9659cd25"
        },
        {
          "url": "https://git.kernel.org/stable/c/9673ca00e6c5503069dc98780e2e89db0e663c16"
        },
        {
          "url": "https://git.kernel.org/stable/c/e4cde54b46a87231c77256a633be1bef62687d69"
        },
        {
          "url": "https://git.kernel.org/stable/c/b58a295d10065960bcb9d60cb8ca6ead9837cd27"
        },
        {
          "url": "https://git.kernel.org/stable/c/9cbca30102028f9ad3d2098f935c4368f581fd07"
        },
        {
          "url": "https://git.kernel.org/stable/c/74fd327767fb784c5875cf7c4ba1217f26020943"
        },
        {
          "url": "https://git.kernel.org/stable/c/028363685bd0b7a19b4a820f82dd905b1dc83999"
        }
      ],
      "title": "espintcp: remove encap socket caching to avoid reference leak",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38097",
    "datePublished": "2025-07-03T08:13:57.694Z",
    "dateReserved": "2025-04-16T04:51:23.985Z",
    "dateUpdated": "2026-10-15T21:52:08.064Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-38097",
      "date": "2026-11-19",
      "epss": "0.00205",
      "percentile": "0.10587"
    },
    "microsoft_vex": {
      "current_release_date": "2026-09-24T02:12:23.000Z",
      "cve": "CVE-2025-38097",
      "id": "msrc_CVE-2025-38097",
      "initial_release_date": "2025-08-07T00:00:00.000Z",
      "product_status:known_affected": "5",
      "product_status:known_not_affected": "1",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "espintcp: remove encap socket caching to avoid reference leak",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2025-38097.json",
      "version": "7"
    },
    "redhat_vex": {
      "aggregate_severity": "Low",
      "current_release_date": "2026-11-06T14:57:02+00:00",
      "cve": "CVE-2025-38097",
      "id": "CVE-2025-38097",
      "initial_release_date": "2025-07-03T00:00:00+00:00",
      "product_status:fixed": "612",
      "product_status:known_affected": "70",
      "product_status:known_not_affected": "42",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: espintcp: remove encap socket caching to avoid reference leak",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-38097.json",
      "version": "3"
    },
    "vulnrichment": {
      "containers": {
        "adp": [
          {
            "providerMetadata": {
              "dateUpdated": "2025-11-03T17:34:02.117Z",
              "orgId": "af854a3a-2127-422b-91ae-364da2661108",
              "shortName": "CVE"
            },
            "references": [
              {
                "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"
              }
            ],
            "title": "CVE Program Container"
          },
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2025-38097",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "total"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2026-10-15T21:47:21.694402Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2026-10-15T21:47:22.502Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "defaultStatus": "unaffected",
              "product": "Linux",
              "programFiles": [
                "include/net/xfrm.h",
                "net/ipv4/esp4.c",
                "net/ipv6/esp6.c",
                "net/xfrm/xfrm_state.c"
              ],
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "vendor": "Linux",
              "versions": [
                {
                  "lessThan": "e32bafd08ee35feacd47b05cc5bfe9cd9659cd25",
                  "status": "affected",
                  "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
                  "versionType": "git"
                },
                {
                  "lessThan": "9673ca00e6c5503069dc98780e2e89db0e663c16",
                  "status": "affected",
                  "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
                  "versionType": "git"
                },
                {
                  "lessThan": "e4cde54b46a87231c77256a633be1bef62687d69",
                  "status": "affected",
                  "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
                  "versionType": "git"
                },
                {
                  "lessThan": "b58a295d10065960bcb9d60cb8ca6ead9837cd27",
                  "status": "affected",
                  "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
                  "versionType": "git"
                },
                {
                  "lessThan": "9cbca30102028f9ad3d2098f935c4368f581fd07",
                  "status": "affected",
                  "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
                  "versionType": "git"
                },
                {
                  "lessThan": "74fd327767fb784c5875cf7c4ba1217f26020943",
                  "status": "affected",
                  "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
                  "versionType": "git"
                },
                {
                  "lessThan": "028363685bd0b7a19b4a820f82dd905b1dc83999",
                  "status": "affected",
                  "version": "e27cca96cd68fa2c6814c90f9a1cfd36bb68c593",
                  "versionType": "git"
                }
              ]
            },
            {
              "defaultStatus": "affected",
              "product": "Linux",
              "programFiles": [
                "include/net/xfrm.h",
                "net/ipv4/esp4.c",
                "net/ipv6/esp6.c",
                "net/xfrm/xfrm_state.c"
              ],
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "vendor": "Linux",
              "versions": [
                {
                  "status": "affected",
                  "version": "5.6"
                },
                {
                  "lessThan": "5.6",
                  "status": "unaffected",
                  "version": "0",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "5.10.*",
                  "status": "unaffected",
                  "version": "5.10.270",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "5.15.*",
                  "status": "unaffected",
                  "version": "5.15.221",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.1.*",
                  "status": "unaffected",
                  "version": "6.1.141",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.6.*",
                  "status": "unaffected",
                  "version": "6.6.93",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.12.*",
                  "status": "unaffected",
                  "version": "6.12.31",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.14.*",
                  "status": "unaffected",
                  "version": "6.14.9",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "*",
                  "status": "unaffected",
                  "version": "6.15",
                  "versionType": "original_commit_for_fix"
                }
              ]
            }
          ],
          "cpeApplicability": [
            {
              "nodes": [
                {
                  "cpeMatch": [
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.10.270",
                      "versionStartIncluding": "5.6",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.15.221",
                      "versionStartIncluding": "5.6",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.1.141",
                      "versionStartIncluding": "5.6",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.6.93",
                      "versionStartIncluding": "5.6",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.12.31",
                      "versionStartIncluding": "5.6",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.14.9",
                      "versionStartIncluding": "5.6",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.15",
                      "versionStartIncluding": "5.6",
                      "vulnerable": true
                    }
                  ],
                  "negate": false,
                  "operator": "OR"
                }
              ]
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nespintcp: remove encap socket caching to avoid reference leak\n\nThe current scheme for caching the encap socket can lead to reference\nleaks when we try to delete the netns.\n\nThe reference chain is: xfrm_state -\u003e enacp_sk -\u003e netns\n\nSince the encap socket is a userspace socket, it holds a reference on\nthe netns. If we delete the espintcp state (through flush or\nindividual delete) before removing the netns, the reference on the\nsocket is dropped and the netns is correctly deleted. Otherwise, the\nnetns may not be reachable anymore (if all processes within the ns\nhave terminated), so we cannot delete the xfrm state to drop its\nreference on the socket.\n\nThis patch results in a small (~2% in my tests) performance\nregression.\n\nA GC-type mechanism could be added for the socket cache, to clear\nreferences if the state hasn\u0027t been used \"recently\", but it\u0027s a lot\nmore complex than just not caching the socket."
            }
          ],
          "metrics": [
            {
              "cvssV3_1": {
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "scenarios": [
                {
                  "lang": "en",
                  "value": "AV:L - The entire attack is driven through local syscalls \u2014 `socket()`+`setsockopt(TCP_ULP,\"espintcp\")` to create the encap socket, NETLINK_XFRM to add/flush the SA and policy, and local traffic to trigger `esp_output_tail_tcp()`. No remote peer input is needed to populate or tear down the cached socket reference.\nAC:L - The reference leak itself is fully deterministic \u2014 create the SA, send one packet, let the namespace go away \u2014 with no race or memory-layout dependency, and `CONFIG_INET_ESPINTCP`/`CONFIG_INET6_ESPINTCP` are enabled in mainstream distro kernels. For the dangling-`encap_sk` window the attacker drives both sides (a traffic generator feeding `xfrm_trans_queue_net()` and a concurrent `xfrm state flush` loop) and can retry indefinitely.\nPR:L - Adding the xfrm state requires CAP_NET_ADMIN, but `xfrm_user.c` uses `netlink_net_capable()`, which resolves against `sock_net(skb-\u003esk)-\u003euser_ns`, so an ordinary unprivileged user obtains it with `unshare -Urn`; attaching the espintcp ULP requires no privilege at all. No real root in the init namespace is needed.\nUI:N - The attacker performs every step \u2014 socket setup, SA installation, packet transmission, and namespace teardown \u2014 entirely on their own. No victim action or cooperating process is involved.\nS:U - The leaked netns/socket and the dangling socket dereference are all kernel objects under the same security authority as the attacking context; no VM, IOMMU, or hypervisor boundary is crossed.\nC:H - After `__xfrm_state_delete()` drops the socket reference without RCU synchronization and leaves `x-\u003eencap_sk` non-NULL, the deferred `esp_find_tcp_sk()` reads `sk-\u003esk_state` and then operates on that released socket; because TCP sockets come from a SLAB_TYPESAFE_BY_RCU cache the slot can already hold an attacker-groomed socket, and `espintcp_getctx()` then follows a foreign `icsk_ulp_data`, giving a use-after-free read primitive over attacker-influenced kernel memory.\nI:H - The stale `x-\u003eencap_sk` also lets the slow path match `sk == nsk` and queue a second `sock_put()` through `call_rcu(esp_free_tcp_sk)`, a refcount underflow that frees a socket userspace still references by fd \u2014 a classic UAF write/heap-grooming primitive, and `bh_lock_sock()`/`espintcp_push_skb()` write into the freed object directly.\nA:H - Each leaked SA permanently pins an entire `struct net` (with all per-net subsystem allocations, sysctls, procfs entries and per-cpu data) that can never be reclaimed, and an unprivileged user can repeat this in a loop until kernel memory is exhausted or netns ucount limits break container creation; the dangling-socket dereference additionally oopses the kernel."
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-09-14T11:58:01.146Z",
            "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "shortName": "Linux"
          },
          "references": [
            {
              "url": "https://git.kernel.org/stable/c/e32bafd08ee35feacd47b05cc5bfe9cd9659cd25"
            },
            {
              "url": "https://git.kernel.org/stable/c/9673ca00e6c5503069dc98780e2e89db0e663c16"
            },
            {
              "url": "https://git.kernel.org/stable/c/e4cde54b46a87231c77256a633be1bef62687d69"
            },
            {
              "url": "https://git.kernel.org/stable/c/b58a295d10065960bcb9d60cb8ca6ead9837cd27"
            },
            {
              "url": "https://git.kernel.org/stable/c/9cbca30102028f9ad3d2098f935c4368f581fd07"
            },
            {
              "url": "https://git.kernel.org/stable/c/74fd327767fb784c5875cf7c4ba1217f26020943"
            },
            {
              "url": "https://git.kernel.org/stable/c/028363685bd0b7a19b4a820f82dd905b1dc83999"
            }
          ],
          "title": "espintcp: remove encap socket caching to avoid reference leak",
          "x_generator": {
            "engine": "bippy-1.2.0"
          }
        }
      },
      "cveMetadata": {
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "assignerShortName": "Linux",
        "cveId": "CVE-2025-38097",
        "datePublished": "2025-07-03T08:13:57.694Z",
        "dateReserved": "2025-04-16T04:51:23.985Z",
        "dateUpdated": "2026-10-15T21:52:08.064Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.