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

CVE-2026-97971: Linux Kernel Privilege Escalation Flaw

CVE-2026-97971 is a privilege escalation vulnerability in the Linux kernel namespace handling that causes reference counting issues. This post explains its technical details, affected versions, and mitigation steps.

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-97971 Overview

CVE-2026-97971 is a Linux kernel vulnerability in the namespace tree (nstree) subsystem. The flaw occurs in legitimize_ns(), which acquires a reference on a candidate namespace before may_list_ns() evaluates whether the caller is permitted to see it. On the denied path, the __free(ns_put) cleanup can drop the last reference to a mount namespace while the RCU read lock is still held. Because put_mnt_ns() may sleep, this triggers a voluntary context switch inside an RCU read-side critical section. The condition mirrors a prior defect fixed by commit 2ec2aff3c8e2 ("ns: make sure reference are dropped outside of rcu lock") for the put_user() path.

Critical Impact

A local, unprivileged user invoking the listns syscall can trigger a sleep within an RCU read-side critical section, destabilizing the kernel and impacting confidentiality, integrity, and availability on affected hosts.

Affected Products

  • Linux kernel (mainline) prior to the fix commits 56ea4e8 and 9e673bf
  • Distributions shipping the vulnerable nstree/listns implementation
  • Systems exposing the listns syscall to unprivileged users

Discovery Timeline

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

Technical Details for CVE-2026-97971

Vulnerability Analysis

The vulnerability lives in the namespace listing path exercised by the listns syscall. During enumeration, legitimize_ns() increments a namespace reference count on a candidate namespace before access is authorized. The subsequent may_list_ns() check may deny visibility, at which point the scope-based __free(ns_put) cleanup releases the just-acquired reference. If that reference was the last one held on a mount namespace, put_mnt_ns() runs synchronously and attempts to take namespace_sem, which can block. Because the cleanup executes while the RCU read lock is held, the kernel performs a voluntary context switch inside an RCU read-side critical section, violating RCU invariants.

The reported splat shows rcu_note_context_switch warning at kernel/rcu/tree_plugin.h:332, with a call chain through mntns_put → put_mnt_ns → namespace_unlock → synchronize_rcu_expedited → mutex_lock. The fix reorders operations: both ns_requested() and may_list_ns() only inspect the namespace type and the caller's own namespaces, so the permission check runs first and the reference is acquired last.

Root Cause

The defect is a lifetime and locking ordering error. A reference is taken on a namespace before the caller is authorized to observe it, placing a potentially-sleeping release inside an RCU read-side critical section when the permission check fails.

Attack Vector

Exploitation is local and requires low privileges. An unprivileged user process invokes listns repeatedly against namespaces it is not permitted to list, forcing the denied-path cleanup to drop the last reference to a mount namespace while under RCU. This produces kernel warnings, scheduling anomalies, and potential system instability.

No verified public proof-of-concept exploit code is available. Refer to the upstream fix commits for implementation detail: Kernel Git Commit 56ea4e8 and Kernel Git Commit 9e673bf.

Detection Methods for CVE-2026-97971

Indicators of Compromise

  • Kernel ring buffer warnings referencing rcu_note_context_switch with the message "Voluntary context switch within RCU read-side critical section".
  • Stack traces containing do_listns, mntns_put, put_mnt_ns, and namespace_unlock in sequence.
  • Unprivileged processes issuing high-frequency listns syscalls against namespaces outside their visibility scope.

Detection Strategies

  • Parse dmesg and /var/log/kern.log for the WARNING at kernel/rcu/tree_plugin.h emitted during the race.
  • Use auditd or eBPF probes to flag unusual rates of the listns syscall from non-root UIDs.
  • Correlate kernel warnings with originating PID, UID, and command name to identify the triggering process.

Monitoring Recommendations

  • Forward kernel logs to a centralized analytics platform and alert on RCU violation signatures.
  • Baseline normal listns syscall volume per workload and alert on sustained deviations.
  • Track kernel version inventory to prioritize hosts still running pre-fix builds.

How to Mitigate CVE-2026-97971

Immediate Actions Required

  • Inventory running kernel versions and identify hosts missing commits 56ea4e8 and 9e673bf.
  • Apply the upstream kernel patches or install the vendor kernel update that integrates both commits.
  • Restrict local shell access on multi-tenant systems where untrusted users can invoke the listns syscall.

Patch Information

The fix reorders checks so that ns_requested() and may_list_ns() execute before legitimize_ns() acquires the reference, preventing the sleeping release inside the RCU read-side critical section. Apply Kernel Git Commit 56ea4e8 and Kernel Git Commit 9e673bf, or upgrade to a distribution kernel that includes both commits.

Workarounds

  • No supported runtime workaround removes the defect; patching the kernel is required.
  • Reduce exposure by limiting local user access and container breakout opportunities on affected hosts.
  • Where feasible, use seccomp policies to deny the listns syscall for workloads that do not need it.
bash
# Verify running kernel and confirm patched version after update
uname -r

# Example seccomp-bpf deny rule for listns in a container runtime policy
# (adjust syscall name/number to match your kernel's listns definition)
{
  "defaultAction": "SCMP_ACT_ALLOW",
  "syscalls": [
    { "names": ["listns"], "action": "SCMP_ACT_ERRNO" }
  ]
}

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.