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

CVE-2026-98818: Linux Kernel Race Condition Vulnerability

CVE-2026-98818 is a race condition flaw in the Linux kernel memory management subsystem that can cause deadlocks when kfree_rcu is called under scheduler locks. 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-98818 Overview

CVE-2026-98818 is a Linux kernel vulnerability in the slab memory allocator. The flaw resides in __kfree_rcu_sheaf() where the function could wake up kswapd while holding the scheduler's pi_lock. Because waking kswapd ultimately requires acquiring pi_lock as well, this creates a circular locking dependency that can deadlock the system.

The condition was confirmed through a lockdep-instrumented kernel that detected a circular dependency chain between &p->pi_lock, kswapd_wakeup, and &pgdat->kswapd_wait. The fix removes __GFP_KSWAPD_RECLAIM from allocations originating in kfree_rcu() paths.

Critical Impact

Local workloads that exercise the set_cpus_allowed_force() path under pi_lock can trigger a system-wide deadlock, resulting in a denial-of-service condition on affected kernels.

Affected Products

  • Linux kernel (mainline mm/slab subsystem)
  • Kernel builds introducing the kfree_rcu() sheaf allocation path
  • Distributions shipping unpatched upstream kernels referenced by commits 46545c86 and af2fb3ee

Discovery Timeline

  • 2026-10-18 - CVE-2026-98818 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98818

Vulnerability Analysis

The vulnerability is a kernel-level deadlock [CWE-833] in the Read-Copy-Update (RCU) sheaf fast path of the slab allocator. kfree_rcu() can be invoked from code paths that already hold pi_lock, a raw spinlock in the scheduler. When the RCU sheaf path needs a new slab page, it enters the page allocator slow path, which calls wake_all_kswapds().

Waking kswapd requires acquiring &pgdat->kswapd_wait, and the wake-up logic eventually re-enters try_to_wake_up(), which takes &p->pi_lock. The result is a classic AB-BA ordering violation: one CPU holds pi_lock and waits for kswapd_wait, while another CPU holds kswapd_wait and waits for pi_lock.

Reproduction is difficult in practice because the set_cpus_allowed_force() → cpuset_cpus_allowed_fallback() → select_fallback_rq() path is rarely taken, and competing allocations usually wake kswapd first. The window exists nonetheless and was proven with an augmented lockdep map.

Root Cause

The root cause is the use of __GFP_KSWAPD_RECLAIM in allocations performed by __kfree_rcu_sheaf() via refill_sheaf() and allocate_slab(). This flag permits the allocator to asynchronously wake kswapd, which is incompatible with any caller that may already hold pi_lock.

Attack Vector

The condition is reachable only locally from kernel execution contexts that call kfree_rcu() while holding pi_lock. There is no network-facing attack vector. A local workload exercising scheduler fallback paths under memory pressure can trigger the deadlock, producing a hang or hard-lockup equivalent to a denial of service.

No exploitation code is applicable. The upstream fix removes the __GFP_KSWAPD_RECLAIM flag from the affected allocation sites so kfree_rcu() cannot schedule kswapd wake-ups. Refer to the patch commits for the exact source changes.

Detection Methods for CVE-2026-98818

Indicators of Compromise

  • Kernel soft-lockup or hard-lockup messages referencing _raw_spin_lock_irqsave, try_to_wake_up, or wakeup_kswapd in stack traces.
  • Lockdep warnings reporting a circular dependency between &p->pi_lock, kswapd_wakeup, and &pgdat->kswapd_wait on kernels built with CONFIG_PROVE_LOCKING.
  • Unresponsive hosts under memory pressure where sysrq shows tasks blocked in __alloc_pages_slowpath and refill_sheaf.

Detection Strategies

  • Enable CONFIG_PROVE_LOCKING and CONFIG_LOCKDEP on test kernels to catch the dependency chain during QA.
  • Monitor /var/log/messages and dmesg for WARNING: possible circular locking dependency detected entries tied to __kfree_rcu_sheaf.
  • Correlate kernel panic dumps with the call stack signature __pcs_replace_empty_main → refill_sheaf → wake_all_kswapds.

Monitoring Recommendations

  • Collect kernel crash dumps using kdump and inspect them with crash for pi_lock ownership at the time of hang.
  • Centralize kernel ring buffer logs to a SIEM or data lake to flag lockdep splats across the fleet.
  • Track running kernel versions against the fixed upstream commits to identify at-risk hosts.

How to Mitigate CVE-2026-98818

Immediate Actions Required

  • Inventory Linux hosts and identify kernel versions that include the RCU sheaf allocation path without the fix.
  • Apply vendor-supplied stable kernel updates that incorporate upstream commits 46545c86 and af2fb3ee.
  • Prioritize patching on systems that run cgroup/cpuset-heavy workloads, where set_cpus_allowed_force() is exercised more often.

Patch Information

The upstream fix removes __GFP_KSWAPD_RECLAIM from allocations initiated by __kfree_rcu_sheaf(), ensuring kfree_rcu() cannot wake kswapd while potentially holding pi_lock. The relevant commits are available from the Linux stable tree: Kernel Git Commit 46545c86 and Kernel Git Commit af2fb3ee. Rebuild and redeploy kernels after applying the patches.

Workarounds

  • No supported runtime workaround exists; the deadlock originates in kernel memory-management internals.
  • Reduce exposure by limiting cpuset reconfiguration and sustained memory-pressure workloads on unpatched hosts.
  • Where feasible, roll back to a kernel series that predates the RCU sheaf allocation path until patched kernels are deployed.

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.