Skip to main content
Vulnerability Database/CVE-2026-98370

CVE-2026-98370: Linux Kernel Use-After-Free Vulnerability

CVE-2026-98370 is a use-after-free flaw in the Linux kernel's xfrm subsystem affecting ALLOCSPI request handling. This vulnerability can lead to memory corruption and system instability. This post covers technical details, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-98370 Overview

CVE-2026-98370 is a use-after-free vulnerability in the Linux kernel's xfrm (IP transformation framework) netlink subsystem. The flaw affects the compat ALLOCSPI request handling path in xfrm_alloc_userspi(). A redundant call to alloc_compat() causes the translator to misinterpret the 228-byte compat xfrm_userspi_info structure as the 232-byte native layout. This triggers a 4-byte out-of-bounds read and attaches a translated child to the request's frag_list. A multicast clone of the request skb can observe the child, which xfrm_user_rcv_msg() later frees while a compat receiver may still be reading it.

Critical Impact

Local attackers on 32-bit compat userspace with netlink xfrm access can trigger a race between xfrm_user_rcv_msg() freeing the translated child and a concurrent multicast receiver reading from it, enabling kernel memory corruption.

Affected Products

  • Linux kernel versions containing the vulnerable xfrm_alloc_userspi() compat translation path
  • Systems with CONFIG_COMPAT enabled serving 32-bit netlink clients
  • Multi-tenant and container hosts exposing xfrm netlink to compat processes

Discovery Timeline

  • 2026-10-06 - CVE CVE-2026-98370 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-98370

Vulnerability Analysis

The xfrm_state_netlink() function builds the ALLOCSPI response using dump_one_state(), which already invokes alloc_compat() against the response skb and header. The subsequent call in xfrm_alloc_userspi() reapplies alloc_compat() using the original request skb and its header rather than the response. For compat callers, the translator then treats the 228-byte compat xfrm_userspi_info payload as if it were the 232-byte native structure, producing a 4-byte read past the declared payload boundary.

The second translation also publishes the translated child skb through the request's frag_list. Because skb_shared_info is shared with multicast clones of the request, those clones gain a reference to the attached child. When the request handler returns, xfrm_user_rcv_msg() frees the child while a compat multicast receiver may still be copying data from it, satisfying the classic use-after-free race condition.

Root Cause

The root cause is a redundant and misdirected alloc_compat() invocation inside xfrm_alloc_userspi(). The response path already performs the correct compat translation via dump_one_state(). Reapplying translation against the inbound request skb both corrupts the size assumption and incorrectly links a translated child into the request's shared fragment list.

Attack Vector

A local unprivileged user with permission to send xfrm netlink messages crafts a compat ALLOCSPI request and arranges a concurrent multicast listener on the xfrm netlink group. The race between the request handler freeing the translated child and the multicast receiver dereferencing it produces a use-after-free in kernel memory. The upstream fix removes the redundant conversion so no child is attached to the inbound request.

Detection Methods for CVE-2026-98370

Indicators of Compromise

  • Unexpected kernel oops or KASAN use-after-free reports referencing xfrm_alloc_userspi, xfrm_user_rcv_msg, or dump_one_state
  • Kernel stack traces involving alloc_compat() and netlink skb fragment list handling
  • Processes repeatedly issuing XFRM_MSG_ALLOCSPI via 32-bit compat netlink while subscribing to xfrm multicast groups

Detection Strategies

  • Enable KASAN on test and staging kernels to surface the use-after-free during fuzzing of the xfrm netlink interface
  • Audit syscall telemetry for compat processes issuing xfrm netlink messages combined with NETLINK_XFRM multicast group subscriptions
  • Monitor kernel ring buffer (dmesg) for warnings referencing xfrm, skb_shared_info, or netlink frag_list corruption

Monitoring Recommendations

  • Centralize kernel logs and alert on panic, oops, or KASAN entries containing xfrm_ symbols
  • Track execution of 32-bit binaries on 64-bit hosts invoking AF_NETLINK sockets with NETLINK_XFRM
  • Baseline normal xfrm netlink activity to detect anomalous bursts of ALLOCSPI requests from unprivileged users

How to Mitigate CVE-2026-98370

Immediate Actions Required

  • Apply the upstream Linux kernel patches that remove the redundant alloc_compat() call in xfrm_alloc_userspi()
  • Prioritize patching hosts that run untrusted 32-bit workloads or multi-tenant containers with CONFIG_COMPAT enabled
  • Restrict CAP_NET_ADMIN and limit which user namespaces can send xfrm netlink messages

Patch Information

The fix is distributed across multiple stable kernel branches. Review the upstream commits for backport selection: Commit 17893987, Commit 24843394, Commit 2b63341e, Commit 42971ea1, Commit 494f2bee, Commit bb63ab52, Commit d1ebd908, and Commit e70f639a.

Workarounds

  • Disable CONFIG_COMPAT on kernels that do not need to run 32-bit userspace
  • Deny unprivileged user namespaces access to AF_NETLINK xfrm sockets through seccomp or LSM policy
  • Use container runtime profiles that block xfrm netlink messages for untrusted workloads
bash
# Example seccomp fragment blocking netlink xfrm socket creation
# in untrusted container profiles
{
  "syscalls": [
    {
      "names": ["socket"],
      "action": "SCMP_ACT_ERRNO",
      "args": [
        { "index": 0, "value": 16, "op": "SCMP_CMP_EQ" },
        { "index": 2, "value": 6,  "op": "SCMP_CMP_EQ" }
      ]
    }
  ]
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.