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

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

CVE-2026-97903 is a use-after-free flaw in the Linux kernel's process exit handling that can cause memory corruption when racing wait4 against setsid. This post explains its 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-97903 Overview

CVE-2026-97903 is a use-after-free vulnerability in the Linux kernel's process exit path. The flaw affects the release_task() function, which drops a reference to thread_pid before proc_flush_pid() executes. A concurrent task calling setsid() or participating in process group management can trigger an RCU callback that frees the PID structure while proc_flush_pid() still dereferences it. KASAN-instrumented kernels reproduce the issue reliably when wait4(-1) races against setsid(). The vulnerability was introduced by commit 0a36bad01731 ("release_task: kill the no longer needed get/put_pid(thread_pid)").

Critical Impact

A local, unprivileged attacker can trigger a slab use-after-free in the kernel PID cache, leading to kernel memory corruption and potential denial of service.

Affected Products

  • Linux kernel v6.19.y and newer (mainline patch applies directly)
  • Linux kernel v6.16.y through v6.18.y (requires context-adjusted backport)
  • Distributions shipping affected stable kernels

Discovery Timeline

  • 2026-09-25 - CVE-2026-97903 published to NVD
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-97903

Vulnerability Analysis

The vulnerability resides in the kernel exit path, specifically in the interaction between release_task() and proc_flush_pid(). The release_task() function invokes __unhash_process() to detach the exiting task from its PID structures, then calls proc_flush_pid() to invalidate associated procfs dentries. Between these operations, the kernel no longer holds an explicit reference to thread_pid.

The original assumption was that free_pids(post.pids) at the end of release_task() would keep thread_pid alive. This assumption fails when another task still uses the exiting task's PID as its process group ID (PGID) or session ID (SID). In that case, __change_pid() does not place the detached PID into post.pids, leaving release_task() without a reference after tasklist_lock is dropped.

Root Cause

The root cause is a missing reference count on thread_pid across the window between __unhash_process() and proc_flush_pid(). Commit 0a36bad01731 removed the explicit get_pid()/put_pid() pair around proc_flush_pid() based on a faulty lifetime assumption. When concurrent process group or session membership exists, the PID can be freed by delayed_put_pid() via an RCU callback before proc_flush_pid() completes, producing a slab use-after-free in proc_invalidate_siblings_dcache() at offset 80 within a 144-byte object from the pid cache (matching pid->inodes).

Attack Vector

Exploitation requires local, unprivileged code execution. An attacker races wait4(-1) in a reaper process against setsid() in a child process to create the vulnerable ordering. The reporter confirmed the race with three of three fresh v7.2 KASAN boots producing identical reports in proc_invalidate_siblings_dcache+0x3e2/0x3f0. The advisory explicitly states that no controlled read, controlled write, information leak, or privilege escalation is claimed. The practical impact is kernel memory corruption that typically manifests as a crash. Technical details are available in the upstream fixes at Kernel Git Commit 96803a12, Kernel Git Commit bcb09368, and Kernel Git Commit cdd812d0.

Detection Methods for CVE-2026-97903

Indicators of Compromise

  • KASAN reports showing slab-use-after-free in proc_invalidate_siblings_dcache with a read of size 8 within a 144-byte pid cache object
  • Kernel oops or panic traces originating from release_task → proc_invalidate_siblings_dcache
  • Free stack traces listing delayed_put_pid and rcu_core paired with allocation from ksys_setsid

Detection Strategies

  • Enable KASAN on test and staging kernels to surface the race during fuzzing or workload testing
  • Monitor /var/log/kern.log and dmesg for use-after-free reports referencing the pid slab cache
  • Audit syscall telemetry for unprivileged processes performing high-frequency setsid() combined with wait4(-1) loops

Monitoring Recommendations

  • Instrument production hosts with kdump to capture crash cores for forensic analysis
  • Correlate kernel panic events with the originating UID and process ancestry
  • Track unexpected process reaper crashes or restarts in long-running services

How to Mitigate CVE-2026-97903

Immediate Actions Required

  • Apply the upstream fix that takes an explicit reference on thread_pid before __unhash_process() and releases it after proc_flush_pid() completes
  • Rebuild and deploy kernels from the stable branches containing commits 96803a12, bcb09368, or cdd812d0 as appropriate for the running series
  • For v6.16.y through v6.18.y, apply the context-adjusted backport referenced in the advisory

Patch Information

The fix reintroduces balanced get_pid()/put_pid() calls around proc_flush_pid() so the PID structure cannot be freed by a concurrent RCU callback. The mainline patch applies directly to v6.19.y and later. Three stable commits are available: Kernel Git Commit 96803a12, Kernel Git Commit bcb09368, and Kernel Git Commit cdd812d0. With the patch applied, three of three fresh KASAN boots completed without reports.

Workarounds

  • No reliable configuration-only workaround exists; the race lives inside the kernel exit path
  • Restrict untrusted local code execution on affected hosts until the patched kernel is deployed
  • Reduce exposure by limiting container and multi-tenant workloads on unpatched 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.