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

CVE-2026-98226: Linux Kernel Privilege Escalation Vulnerability

CVE-2026-98226 is a privilege escalation flaw in the Linux kernel swap management that causes counter corruption and potential data loss. This post explains its technical details, impact, 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-98226 Overview

CVE-2026-98226 is a Linux kernel memory management flaw in the swap subsystem. The SWAP_USAGE_OFFLIST_BIT flag collides with the real si->inuse_pages usage counter once the counter reaches 4 TiB on systems with 4 KiB pages. The flag was defined using BITS_PER_TYPE(atomic_t), placing it at bit 30 inside a counter that can legitimately grow beyond that value. The collision corrupts swap accounting, understates /proc/swaps usage by 4 TiB, and can cause swapoff to tear down a device while pages remain swapped out, resulting in lost data.

Critical Impact

On large-memory Linux systems using swap volumes that exceed 4 TiB, the counter collision can cause silent data loss during swapoff and corrupt kernel plist structures.

Affected Products

  • Linux kernel versions containing the SWAP_USAGE_OFFLIST_BIT definition based on BITS_PER_TYPE(atomic_t)
  • Systems with 4 KiB page size and swap devices approaching or exceeding 4 TiB in use
  • Distributions shipping the affected mainline mm/swap code prior to the referenced stable commits

Discovery Timeline

  • 2026-10-06 - CVE-2026-98226 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-98226

Vulnerability Analysis

The Linux kernel's swap subsystem tracks in-use swap pages through the si->inuse_pages atomic counter. The SWAP_USAGE_OFFLIST_BIT flag is embedded in that same counter and is intended to sit above the maximum real count. The flag was defined using BITS_PER_TYPE(atomic_t), which evaluates to bit 30. On a 4 KiB page system, the counter can legitimately reach that bit once swap usage hits 4 TiB.

When the real count reaches a value with bit 30 set, swap_usage_in_pages() masks the flag bit and returns a value 4 TiB lower than reality. The misreported count propagates to /proc/swaps and to internal control flow decisions. The flaw is categorized as a kernel accounting error with downstream data-loss and list-corruption consequences.

Root Cause

The root cause is an incorrect sizing assumption. SWAP_USAGE_OFFLIST_BIT was derived from the width of atomic_t (32 bits) and placed at bit 30, overlapping the legal range of the usage counter. The fix redefines the flag against atomic_long_t, which matches the actual type of the counter field, placing the flag above any value the counter can reach on 64-bit systems.

Attack Vector

The flaw is triggered by legitimate workload conditions rather than by a crafted network payload. A local administrator or workload that drives swap usage past the 4 TiB threshold and then invokes swapoff can observe the condition. Inside try_to_unuse(), the masked return value of swap_usage_in_pages() returning zero causes the early exit if (!swap_usage_in_pages(si)) goto success; to fire. Nothing in the remainder of the swapoff path re-validates the count, so the device is torn down with pages still swapped out and those pages are lost.

Independently of swapoff, a free that leaves bit 30 set in the counter causes swap_usage_sub() to misinterpret the real count as the offlist flag. It calls add_to_avail_list(), clears the bit via fetch_and(~SWAP_USAGE_OFFLIST_BIT), and invokes plist_add() on a device already present in the list. This trips WARN_ON(!plist_node_empty(node)) and double-links the plist node, corrupting kernel data structures. See the upstream fixes in Kernel Git Commit 0a41a46, Kernel Git Commit 12e9ac7, and Kernel Git Commit 7c0d0d6 for the exact code change.

Detection Methods for CVE-2026-98226

Indicators of Compromise

  • Kernel warnings referencing WARN_ON(!plist_node_empty(node)) originating from plist_add() in the swap code path
  • /proc/swaps reporting a Used value that is approximately 4 TiB lower than expected on hosts with very large swap volumes
  • Unexplained missing pages or application memory faults after a swapoff operation on a large swap device

Detection Strategies

  • Inventory Linux hosts running mainline kernels with large swap configurations and verify the kernel build predates the fix commits listed in the references
  • Monitor dmesg and journal logs for plist and swap subsystem warnings on long-lived servers with high swap utilization
  • Compare the sum of reported swap usage from /proc/swaps against process-level accounting from /proc/*/smaps to detect undercounting

Monitoring Recommendations

  • Alert on swapoff invocations against swap devices larger than 4 TiB on 4 KiB page systems
  • Track kernel version drift across the fleet to confirm patched builds roll out to all large-memory hosts
  • Capture kernel ring buffer entries into a centralized log pipeline for post-incident analysis of swap-related warnings

How to Mitigate CVE-2026-98226

Immediate Actions Required

  • Apply the mainline and stable kernel updates that redefine SWAP_USAGE_OFFLIST_BIT against atomic_long_t
  • Avoid executing swapoff on swap devices whose in-use pages may exceed the 4 TiB threshold until patches are deployed
  • Audit systems using multi-terabyte swap volumes and schedule reboots into patched kernels during the next maintenance window

Patch Information

The upstream fix changes the definition of SWAP_USAGE_OFFLIST_BIT to be based on atomic_long_t so the flag bit sits above any value the counter can reach. Patch commits are available at Kernel Git Commit 0a41a46, Kernel Git Commit 12e9ac7, and Kernel Git Commit 7c0d0d6. Consume the fix through your distribution's kernel update channel.

Workarounds

  • Reduce swap device size or cap workload swap consumption so the real inuse_pages count stays well below 4 TiB on 4 KiB page systems
  • Defer swapoff operations on affected hosts until a patched kernel is in place
  • Use huge-page configurations where appropriate to lower the page-count footprint of resident swap usage

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.