# CVE-2026-99736: mm/shmem: fix accounting of swapin-error markers

Status: published. Published: 2026-11-20. Updated: 2026-11-23.

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

mm/shmem: fix accounting of swapin-error markers

A failed swap read replaces the swap entry with a swapin-error marker in
the page-cache and subtracts its pages from "alloced" and "swapped";
however, it leaves their block charge in place.

Removing the marker during truncate then subtracts from "swapped" again.
This can underflow the counters or make swapped reach zero while other
pages remain swapped out, causing swapoff to loop without finding them.

When installing the marker, subtract only from "swapped" and let
shmem_recalc_inode() reduce "alloced" and release the block charge.

Make shmem_free_swap() report successful removal separately from the
number of swap pages freed, so removing a swapin-error marker does not
subtract from "swapped" again.

It's a bit confusing, but replacing a swapped out page by a swapin-error
marker in shmem_set_folio_swapin_error() behaves as follows:

Initially:
	alloced=1, swapped=1, nrpages=0
Calling shmem_recalc_inode(inode, 0, -1)
	-> swapped = 0
	-> freed =  1 - 0 - 0 = 1
	-> alloced -= freed
	-> alloced=0, swapped=0, block charge released

## Remediation

No remediation reported in collected sources

## Affected products and versions

- Linux / Linux: ≥ 6cec2b95dadf77cdc1256fae1c5dfd4a2b467e61; < 00e3efd5d74d18447438edfd2532cd4100fd5756 (affected, git); ≥ 6cec2b95dadf77cdc1256fae1c5dfd4a2b467e61; < 5e09340badaf982a2cb73e41da715fcdd0e2eb7f (affected, git); ≥ 6cec2b95dadf77cdc1256fae1c5dfd4a2b467e61; < 77ad4ac35977d081f2b69f1c73ae3b210124b1fc (affected, git); ≥ 6cec2b95dadf77cdc1256fae1c5dfd4a2b467e61; < f49d40a699bdaf68bbb307f1fa207512520ce982 (affected, git); ≥ 6cec2b95dadf77cdc1256fae1c5dfd4a2b467e61; < d4bc03eaeef281c460370dfd57e1a671b787edd4 (affected, git); ≥ 6cec2b95dadf77cdc1256fae1c5dfd4a2b467e61; < 66ce68a249f4ac56cd6968aa6d8ded20fb4b7d09 (affected, git). Source: CNA: Linux
- Linux / Linux: 5.19 (affected); ≥ 0; < 5.19 (unaffected, semver); ≥ 6.1.193; ≤ 6.1.* (unaffected, semver); ≥ 6.6.163; ≤ 6.6.* (unaffected, semver); ≥ 6.12.119; ≤ 6.12.* (unaffected, semver); ≥ 6.18.65; ≤ 6.18.* (unaffected, semver); ≥ 7.3.5; ≤ 7.3.* (unaffected, semver); ≥ 7.4-rc2; ≤ * (unaffected, original_commit_for_fix). Source: CNA: Linux

## Severity and prioritization

- CISA KEV: No listing in collected sources

- EPSS: 0.16% as of 2026-11-22; percentile 4.72%

- SSVC: Not available

- Weaknesses: Not reported

## Exploit evidence

No exploit evidence in collected sources. This is not proof of no exploitation.

## References

- https://git.kernel.org/stable/c/00e3efd5d74d18447438edfd2532cd4100fd5756 (CNA: Linux)

- https://git.kernel.org/stable/c/5e09340badaf982a2cb73e41da715fcdd0e2eb7f (CNA: Linux)

- https://git.kernel.org/stable/c/77ad4ac35977d081f2b69f1c73ae3b210124b1fc (CNA: Linux)

- https://git.kernel.org/stable/c/f49d40a699bdaf68bbb307f1fa207512520ce982 (CNA: Linux)

- https://git.kernel.org/stable/c/d4bc03eaeef281c460370dfd57e1a671b787edd4 (CNA: Linux)

- https://git.kernel.org/stable/c/66ce68a249f4ac56cd6968aa6d8ded20fb4b7d09 (CNA: Linux)

- https://git.kernel.org/stable/c/66ce68a249f4ac56cd6968aa6d8ded20fb4b7d09 (416baaa9-dc9f-4396-8d5f-8c081fb06d67)

- https://git.kernel.org/stable/c/d4bc03eaeef281c460370dfd57e1a671b787edd4 (416baaa9-dc9f-4396-8d5f-8c081fb06d67)

## Provenance

- CNA: Linux: https://www.cve.org/CVERecord?id=CVE-2026-99736; retrieved 2026-11-23; source updated 2026-11-23

- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-99736; retrieved 2026-11-20; source updated 2026-11-20

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-99736; retrieved 2026-11-23; source updated Not reported

Revision: ae0f9edf3bfa033f256c3463c21d39e4d7f576c9a5fdc11dbf43ac5963a994bb

Canonical: https://y2.dev/cve/CVE-2026-99736

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.