Skip to content
Heist/ feed
Unrated

mm, swap: fix SWAP_USAGE_OFFLIST_BIT collision with real usage count

Type: advisorySource: Official CVE List1 source record

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

Announced Source revision 1
Original source ↗

CVE-2026-98226

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2026-98226

Linux

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Linux

Source reference: /containers/cna/affected/1/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "b228386cf237e659cdf5d8037a19db0b0a06f6b5",
        "lessThan": "0a41a46859df0d2bd7ed127197aac7c7389c00ed",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "b228386cf237e659cdf5d8037a19db0b0a06f6b5",
        "lessThan": "7c0d0d6de46076b43a2acaf1026b6648f8434c39",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "b228386cf237e659cdf5d8037a19db0b0a06f6b5",
        "lessThan": "12e9ac7bc5b254048f886bf421e3a15491106c1f",
        "versionType": "git"
      }
    ],
    "programFiles": [
      "mm/swapfile.c"
    ],
    "defaultStatus": "unaffected"
  },
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "6.14"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "6.14",
        "versionType": "semver"
      },
      {
        "status": "unaffected",
        "version": "6.18.54",
        "versionType": "semver",
        "lessThanOrEqual": "6.18.*"
      },
      {
        "status": "unaffected",
        "version": "7.2.8",
        "versionType": "semver",
        "lessThanOrEqual": "7.2.*"
      },
      {
        "status": "unaffected",
        "version": "7.3",
        "versionType": "original_commit_for_fix",
        "lessThanOrEqual": "*"
      }
    ],
    "programFiles": [
      "mm/swapfile.c"
    ],
    "defaultStatus": "affected"
  }
]
Related CVEs
CVE-2026-98226

Source reference: /cveMetadata/cveId

Publisher severity

No explicit severity was provided.

Event
#38305 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement