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

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

CVE-2026-97938 is a use-after-free race condition in the Linux kernel's reboot subsystem affecting cad_pid handling. Attackers may exploit this flaw to corrupt memory. This article 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-97938 Overview

CVE-2026-97938 is a use-after-free race condition in the Linux kernel's reboot subsystem. The flaw affects the cad_pid kernel-wide struct pid pointer used by Ctrl-Alt-Delete handling and related sysctl interfaces. The function proc_do_cad_pid() reads cad_pid and passes it to pid_vnr() without protecting the lifetime of the referenced struct pid. A concurrent writer can replace cad_pid and drop the final reference to the old struct pid while a reader is still dereferencing it. The same lifetime race exists in kill_cad_pid() when it passes cad_pid to kill_pid().

Critical Impact

Concurrent access to the cad_pid pointer can trigger a use-after-free, leading to kernel memory corruption and potential denial of service or privilege escalation on affected Linux systems.

Affected Products

  • Linux kernel (upstream)
  • Linux stable branches patched by commits 5a88f78, 9a17b0e, and ad72e25
  • Downstream Linux distributions shipping unpatched stable kernels

Discovery Timeline

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

Technical Details for CVE-2026-97938

Vulnerability Analysis

The cad_pid symbol in the Linux kernel is a single kernel-wide struct pid pointer that identifies the process to notify on a Ctrl-Alt-Delete reboot event. Two code paths read it: proc_do_cad_pid(), exposed through the reboot sysctl, and kill_cad_pid(), invoked during reboot signaling. Both load the pointer and dereference it without synchronization against writers that can replace cad_pid and release the previous reference. If the final reference drops between the pointer load and the dereference, the reader operates on freed memory. The original KASAN report captured the crash in pid_nr_ns() at kernel/pid.c:545, reached through pid_vnr() and proc_do_cad_pid().

Root Cause

The root cause is missing lifetime protection on the global cad_pid pointer. Readers assumed the referenced struct pid would remain valid for the duration of the operation, but writers could free it concurrently. This is a classic use-after-free arising from an unsynchronized shared pointer [CWE-416]. A related exposure allowed unprivileged users to reach the sysctl through user and PID namespaces because cad_pid was registered in pid_table[]; moving it back to the global reboot sysctl table corrected the namespace mismatch but did not address the race.

Attack Vector

Exploitation requires a local attacker able to trigger concurrent reads and writes against cad_pid. On vulnerable configurations where the sysctl was reachable via user and PID namespaces, an unprivileged user could race proc_do_cad_pid() against writers to free the pointer mid-dereference. Successful exploitation corrupts kernel memory, enabling denial of service or potential escalation depending on allocator state at the time of the free.

No verified public exploit code is available. See the upstream fixes in Kernel Git Commit 5a88f78, Kernel Git Commit 9a17b0e, and Kernel Git Commit ad72e25 for authoritative patch details.

Detection Methods for CVE-2026-97938

Indicators of Compromise

  • KASAN use-after-free reports naming pid_nr_ns, pid_vnr, or proc_do_cad_pid in the call stack.
  • Unexpected kernel oops or panic traces originating from kernel/pid.c during reboot sysctl access.
  • Repeated writes to /proc/sys/kernel/cad_pid from unprivileged processes or non-root PID namespaces.

Detection Strategies

  • Audit kernel versions across the fleet and flag hosts running Linux kernels predating the fix commits 5a88f78, 9a17b0e, and ad72e25.
  • Enable KASAN on test and canary systems to surface the race deterministically during stress testing of reboot sysctls.
  • Collect kernel ring buffer output (dmesg) centrally and alert on BUG: KASAN: use-after-free entries referencing cad_pid paths.

Monitoring Recommendations

  • Monitor sysctl write activity targeting kernel.cad_pid and correlate with the invoking UID and namespace.
  • Track kernel crash telemetry and auto-restart events on Linux hosts to detect exploitation attempts.
  • Review user and PID namespace creation rates for anomalous spikes that may indicate race-condition fuzzing.

How to Mitigate CVE-2026-97938

Immediate Actions Required

  • Apply the upstream Linux kernel patches referenced by commits 5a88f78, 9a17b0e, and ad72e25 or update to a distribution kernel that includes them.
  • Restrict the ability to create unprivileged user namespaces where operationally feasible, reducing the attack surface for local race-condition exploitation.
  • Reboot affected systems after patching to ensure the fixed kernel is loaded.

Patch Information

The upstream fix treats cad_pid as an RCU-protected pointer at both read sites and waits for a grace period before dropping the old reference on the write side. call_rcu(&old_pid->rcu, ...) cannot be used because free_pid() also queues pid->rcu, and queueing the same rcu_head twice can corrupt the RCU callback list. Patch details are available in Kernel Git Commit 5a88f78, Kernel Git Commit 9a17b0e, and Kernel Git Commit ad72e25.

Workarounds

  • Disable unprivileged user namespaces via sysctl -w kernel.unprivileged_userns_clone=0 on distributions that support the toggle to limit namespace-based access to the sysctl.
  • Restrict write access to /proc/sys/kernel/cad_pid to privileged processes only, verifying that namespace exposure has been removed.
  • Apply mandatory access control policies (SELinux, AppArmor) that constrain which processes can modify reboot-related sysctls.
bash
# Verify kernel version and check for the patch
uname -r

# Restrict unprivileged user namespace creation (where supported)
sysctl -w kernel.unprivileged_userns_clone=0

# Confirm cad_pid sysctl permissions
ls -l /proc/sys/kernel/cad_pid

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.