CVE-2026-98226

mm, swap: fix SWAP_USAGE_OFFLIST_BIT collision with real usage count

Published Oct 6, 2026 CVSS 3.1 · 7.0 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The Linux kernel’s swap subsystem uses a dedicated bit, SWAP_USAGE_OFFLIST_BIT, inside the swap usage counter. The bit was defined as bit 30 of an atomic_t type, which is valid for a counter only up to 4 TiB for 4 KiB pages. When the usage counter reaches 4 TiB, SWAP_USAGE_OFFLIST_BIT collides with the real counter value. This collision causes /proc/swaps to report 4 TiB fewer pages in use, and when the bit is set the kernel’s try_to_unuse() routine incorrectly concludes that the swap device can be torn down. The device is then deactivated while pages are still swapped out, leading to permanent loss of those pages. In addition, the collision corrupts the hardware‑free path and the plist of swap devices, generating WARN_ON conditions and inconsistent list entries. The result is data loss, potential crashes, and underrepresentation of swap usage in monitoring tools.

Affected Systems

Affected by this kernel bug in any Linux kernel that contains the original SWAP_USAGE_OFFLIST_BIT definition. The flaw is present before the patch referenced in the provided kernel commit links and applies to all Linux distributions that ship the unpatched code.

Risk and Exploitability

The CVE description does not disclose which access level is required for exploitation. The vulnerability could be triggered by any process executing swapoff when the counter has a high value, which could lead to pages being lost. The likelihood of exploitation appears low, with an EPSS score of less than 1% and no listing in the CISA KEV catalog. No public exploits are currently known.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the kernel patch that changes SWAP_USAGE_OFFLIST_BIT to be based on atomic_long_t; the patch is available in the commit logs linked in the references.
  • If a kernel update is not immediately possible, avoid executing swapoff while the system is using near‑maximum swap; place a monitoring loop or a systemd service that blocks swapoff until usage drops below a safe threshold.
  • Continuously monitor /proc/swaps for sudden resets in the used value; log any such events so that a mis‑behaving swapoff can be investigated early.

Generated by OpenCVE AI on October 10, 2026 at 03:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-9019-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9020-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9160-1 Linux kernel (Azure) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-665
Type Values Removed Values Added
Weaknesses CWE-190
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.0, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-665
Type Values Removed Values Added
Weaknesses CWE-189
Type Values Removed Values Added
Weaknesses CWE-189
Type Values Removed Values Added
Description 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.
Title mm, swap: fix SWAP_USAGE_OFFLIST_BIT collision with real usage count
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 19, 2026, 9:15 AM
Reserved
Sep 25, 2026, 10:25 AM
Status
Received
Published
Oct 6, 2026, 9:18 AM
Modified
Oct 19, 2026, 10:18 AM
Severity
Moderate
Public date
Oct 6, 2026, 12:00 AM