CVE-2026-98226 in Linuxinfo

Summary

by MITRE • 10/06/2026

In the Linux kernel, the following vulnerability has been resolved:

mm, swap: fix SWAP_USAGE_OFFLIST_BIT collision with real usage count

SWAP_USAGE_OFFLIST_BIT is embedded in the si->inuse_pages usage counter, and is meant to sit above any value that counter can reach. However, it is defined from BITS_PER_TYPE(atomic_t), so it is bit 30. On a system with 4 KiB pages the flag collides with the usage count once that count reaches 4 TiB.

swap_usage_in_pages() masks bit 30 out, so whenever the real count has that bit set, every caller of it reads 4 TiB low:

* /proc/swaps understates Used by 4 TiB.

* A raw count of exactly 2^30 masks to zero, so try_to_unuse() takes its "if (!swap_usage_in_pages(si)) goto success;" early exit and swapoff tears the device down while pages are still swapped out. Nothing in the rest of swapoff aborts the teardown, so those pages are lost.

Independently of swapoff, the collision also corrupts the counter and the plist. On a device in normal use, a free that leaves bit 30 set in the count makes swap_usage_sub() see the flag where there is only count, and call add_to_avail_list(). It clears the bit with fetch_and(~SWAP_USAGE_OFFLIST_BIT), leaving the stored count 4 TiB below the real one, and calls plist_add() on a device that is already listed, tripping the WARN_ON(!plist_node_empty(node)) in plist_add() and linking the node a second time.

Change the definition of SWAP_USAGE_OFFLIST_BIT to be based on atomic_long_t instead. Note that the usage counter field itself is of this same type, so it is still a valid bit.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 10/06/2026

The Linux kernel swap subsystem contains a critical integer overflow vulnerability arising from an incorrect bitwise flag definition within the memory management component. The SWAP_USAGE_OFFLIST_BIT was originally defined based on BITS_PER_TYPE for atomic_t, which typically corresponds to 32-bit integers in many architectures. This placement positions the bit at position thirty, effectively capping the usable range of the swap usage counter before it reaches its theoretical maximum. On systems utilizing standard four-kilobyte memory pages, this configuration causes a collision between the flag and the actual page count once the total swapped-out data exceeds approximately four terabytes. The fundamental flaw lies in the mismatch between the width of the atomic integer type used for general counters and the wider long integer type actually employed by the swap usage counter field itself. This architectural inconsistency creates a scenario where legitimate high-volume swap activity triggers false positives, leading to severe operational failures including data loss and kernel warnings that can destabilize system stability.

The immediate impact of this collision manifests in multiple critical failure modes within the swap management logic. When the real usage count reaches or exceeds four terabytes, bit thirty becomes set as part of the numerical value rather than as a distinct flag. Functions such as swap_usage_in_pages mask out this bit to isolate the flag status, which inadvertently strips away the high-order bits of the actual count. Consequently, tools like /proc/swaps report usage figures that are artificially low by four terabytes, providing administrators with dangerously inaccurate system state information. More critically, if the raw count is exactly two raised to the power of thirty, masking results in a value of zero. This false zero triggers an early exit condition within try_to_unuse(), causing swapoff operations to proceed under the assumption that no pages are currently swapped out on the device.

This erroneous logic leads to catastrophic data loss during unmounting or disabling of swap devices. Because the system believes the device is empty, it proceeds with teardown procedures while significant amounts of user data remain resident in swap space. The rest of the swapoff routine lacks safeguards to abort this process when pages are still present, resulting in those swapped-out pages being permanently lost without warning. Beyond immediate data loss, the collision corrupts internal kernel data structures over time. When a free operation occurs that leaves bit thirty set in the count, subsequent calls to swap_usage_sub misinterpret this bit as the offlist flag rather than part of the numerical value. This confusion causes the system to incorrectly add the device back into the available list via plist_add(), even if it is already listed.

The corruption of these linked lists triggers kernel warnings through WARN_ON checks within plist_add, indicating a violation of internal consistency invariants. Specifically, linking a node that is already present creates duplicate entries in the priority queue structures used for swap management. This structural integrity failure can lead to unpredictable behavior during future memory allocation and swapping decisions, potentially causing performance degradation or further logic errors as the kernel attempts to navigate corrupted data structures. The issue highlights the dangers of assuming uniform integer widths across different subsystems within a complex operating system like Linux, where atomic types may not align with long integer expectations in all contexts.

To resolve this vulnerability, the definition of SWAP_USAGE_OFFLIST_BIT was updated to be based on atomic_long_t rather than atomic_t. This adjustment ensures that the bit position corresponds correctly to the width of the swap usage counter field, which is already defined as an atomic long type. By aligning the flag's bit position with the actual data structure size, the collision at four terabytes is eliminated, allowing systems with large amounts of RAM and extensive swap usage to operate without risk of false zero counts or list corruption. This fix preserves the integrity of both the reported statistics and the internal management structures, preventing accidental data loss during device teardowns.

From a classification perspective, this vulnerability aligns with CWE-190 Integer Overflow or Wraparound, as the limited width of the atomic type caused an overflow into flag bits intended for control logic rather than numerical storage. It also relates to CWE-824 Access of Uninitialized Memory if one considers the potential state inconsistencies resulting from corrupted lists, though primarily it is a design flaw in bit manipulation and type sizing. In terms of attack vectors or operational impact mapping within MITRE ATT&CK, this falls under Defense Evasion via Indicator Removal on Hosts because swapoff tearing down devices with active pages effectively destroys evidence stored in swap space without proper logging or user notification. Additionally, the resulting system instability can be categorized under Impact: Resource Availability as it leads to data loss and potential denial of service through kernel warnings and structural corruption.

Mitigation strategies for organizations running affected Linux kernels involve applying vendor-provided patches that update the SWAP_USAGE_OFFLIST_BIT definition immediately upon release. For systems where patching is not immediately feasible, administrators should monitor swap usage closely using tools that do not rely on the corrupted counters if possible, although /proc/swaps will remain inaccurate until patched. Implementing strict limits on total swap size to stay below four terabytes can serve as a temporary workaround for specific high-memory environments, though this reduces system flexibility and may impact performance under heavy load. Long-term resilience requires ensuring that kernel developers rigorously validate bit manipulation logic against the actual types used in data structures, particularly when dealing with counters that approach large numerical thresholds. Regular auditing of swap configurations and monitoring for unexpected WARN_ON messages in dmesg logs can help detect residual issues or similar vulnerabilities in other subsystems before they lead to catastrophic failures.

Responsible

Linux

Reservation

09/25/2026

Disclosure

10/06/2026

Moderation

accepted

EPSS

0.00173

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!