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

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

CVE-2026-98231 is a use-after-free flaw in the Linux kernel xfrm subsystem that can lead to memory corruption during state destruction. This article covers technical details, affected versions, 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-98231 Overview

CVE-2026-98231 is a use-after-free vulnerability in the Linux kernel's xfrm (IPsec transform) subsystem. The flaw lives in xfrm_dev_state_flush(), where the deferred-device pass locates states under xfrm_state_dev_gc_lock but releases the lock before calling xfrm_dev_state_free() because the driver callback may sleep. The device garbage collection (GC) list does not hold an xfrm_state reference, allowing the state GC worker to destroy the same state concurrently. KASAN reports a slab-use-after-free during IPsec state teardown triggered through standard network interface flag changes.

Critical Impact

Concurrent execution of xfrm_state_gc_task and xfrm_dev_state_flush can free the same xfrm_state object twice and dereference memory after free, enabling local denial of service and potential kernel memory corruption.

Affected Products

  • Linux kernel versions containing the xfrm device offload state flush code path prior to the referenced fix commits
  • Distributions shipping affected mainline and stable kernels with IPsec hardware offload enabled
  • Systems using xfrm state device offload with drivers whose teardown callbacks may sleep

Discovery Timeline

  • 2026-10-06 - CVE-2026-98231 published to the National Vulnerability Database (NVD)
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-98231

Vulnerability Analysis

The xfrm subsystem manages IPsec state objects, including states offloaded to network devices. During device teardown, xfrm_dev_state_flush() walks the device GC list to release state entries associated with the departing device. Because driver teardown callbacks may sleep, the code drops xfrm_state_dev_gc_lock before invoking xfrm_dev_state_free().

The device GC list does not hold a reference to the xfrm_state. A separate asynchronous worker, xfrm_state_gc_task, can traverse the main state GC list and call xfrm_state_gc_destroy() on the same state. Both code paths can therefore reach xfrm_dev_state_free() and the driver callback concurrently, producing a double invocation of the driver release path and a use-after-free when the flush path reads x->xso.dev after the GC worker has freed x.

KASAN captured the condition in a devinet_ioctl() call chain triggered by netif_change_flags() on an interface with offloaded IPsec state. The vulnerability is classified as a Race Condition and Use-After-Free in kernel code.

Root Cause

The root cause is missing serialization between the deferred-device flush path and the state garbage collection worker. The device GC list carries no reference count on the xfrm_state, and dropping xfrm_state_dev_gc_lock to allow sleeping callbacks opens a window in which the state can be concurrently destroyed.

Attack Vector

A local attacker with privileges to toggle network interface flags, or to add and remove IPsec state via Netlink, can race xfrm_add_sa and interface flag changes to trigger concurrent destruction. The reported proof-of-concept executes as an unprivileged-looking task issuing devinet_ioctl operations that cascade into xfrm_dev_event and the vulnerable flush path.

See the upstream fix in Linux Kernel Commit 937108dc and backports 39e41af3, 75fc4561, 84e37839, and 89fefad9 for technical details.

Detection Methods for CVE-2026-98231

Indicators of Compromise

  • Kernel KASAN reports naming xfrm_dev_state_free with slab-use-after-free in the call stack
  • Oops or panic traces including xfrm_dev_state_flush, xfrm_dev_event, and notifier_call_chain
  • Unexpected IPsec state teardown correlated with interface flag changes on hosts using hardware offload

Detection Strategies

  • Enable KASAN on test and canary kernels to surface the race during fuzzing or production regression testing
  • Audit kernel logs for xfrm stack traces following devinet_ioctl or dev_change_flags activity
  • Correlate Netlink xfrm_user_rcv_msg state additions with subsequent interface state transitions in telemetry

Monitoring Recommendations

  • Forward dmesg and kernel ring buffer events to a centralized log pipeline for KASAN and oops signatures
  • Monitor Netlink and ioctl activity from non-root processes that manipulate IPsec state or interface flags
  • Track kernel version inventory across Linux fleets to confirm patch coverage on IPsec offload hosts

How to Mitigate CVE-2026-98231

Immediate Actions Required

  • Apply the stable kernel updates referenced in the upstream commits as soon as distribution builds are available
  • Prioritize patching on hosts that use IPsec hardware offload with drivers whose teardown callbacks may sleep
  • Restrict CAP_NET_ADMIN and Netlink XFRM access to trusted administrative accounts

Patch Information

The upstream fix serializes xfrm_state destruction against the deferred-device pass with a mutex, keeping xfrm_state_dev_gc_lock limited to list operations while preserving the existing callback and device-reference release ordering. Reference commits: 937108dc, 39e41af3, 75fc4561, 84e37839, and 89fefad9.

Workarounds

  • Disable IPsec hardware offload on affected drivers until patched kernels are deployed
  • Remove or restrict the ability of untrusted local users to change network interface flags
  • Avoid dynamic bring-up and tear-down of interfaces carrying offloaded xfrm states on vulnerable kernels

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.