# CVE-2026-98226: mm, swap: fix SWAP_USAGE_OFFLIST_BIT collision with real usage count

> An integer overflow in the Linux kernel swap subsystem can cause data loss and system instability when swap usage exceeds 4 TiB.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Oct 2026
- **Updated:** 19 Oct 2026
- **Also known as:** BELL-CVE-2026-98226, DEBIAN-CVE-2026-98226, GHSA-7gvc-xwfg-q86p, UBUNTU-CVE-2026-98226

## What is CVE-2026-98226?

CVE-2026-98226 is a vulnerability in Linux, published on 6 Oct 2026. 

### Official 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.

## Which versions are affected by CVE-2026-98226?


## How do I fix CVE-2026-98226?

Apply the vendor's patch.

## Is CVE-2026-98226 being exploited?

There is no known exploitation of CVE-2026-98226 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-98226 and fix it if it is affected.

What it is: CVE-2026-98226 is a vulnerability in Linux, published on 6 Oct 2026. 
Exploitation: There is no known exploitation of CVE-2026-98226 in the wild and no public exploit code.

Affected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-98226/ (Markdown: https://insights.sbomify.com/CVE-2026-98226/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-98226
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-98226
- OSV: https://osv.dev/vulnerability/CVE-2026-98226

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-98226/
Summaries are generated and may contain mistakes; the official description above is the record.
