Skip to content
FlawDB
Sign in

CVE-2026-139799

HIGH 7.0

mm/shmem: hold off eviction in shmem_writeout()

Mitigation

  • Upgrade Linux to 8f59173b5ca358bf4d1017b44da3cbe6faa80daf or later.

Who should check

  • Anyone running Linux >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < d64fd1229fb1437d7c62c49eba82691bfd65d541; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < f53ee5a65460010cabd75895d83258d90923ca7a; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < 8f59173b5ca358bf4d1017b44da3cbe6faa80daf
  • Anyone running Linux 6.17

Vulnerability facts

Affected
Linux >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < d64fd1229fb1437d7c62c49eba82691bfd65d541; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < f53ee5a65460010cabd75895d83258d90923ca7a; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < 8f59173b5ca358bf4d1017b44da3cbe6faa80daf; Linux 6.17
Fixed in
Linux 8f59173b5ca358bf4d1017b44da3cbe6faa80daf
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
7.0 (v3.1, CNA)CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Local
  • Attack complexity: High
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
Published
Modified

Description

In the Linux kernel, the following vulnerability has been resolved: mm/shmem: hold off eviction in shmem_writeout() Once shmem_writeout() has moved the folio from the page cache to the swap cache, the folio lock no longer keeps the inode alive: truncation and eviction find a swap entry, free it and do not wait for anybody. That did not matter as long as swap_writeout() was the last thing the function did. But since it puts the folio back when swap_writeout() returns AOP_WRITEPAGE_ACTIVATE, it uses the mapping and the inode afterwards: reclaim last close of an unlinked file shmem_writeout() shmem_delete_from_page_cache() swap_writeout() zswap_store() fails shmem_evict_inode() writeback is disabled shmem_truncate_range() return AOP_WRITEPAGE_ACTIVATE shmem_free_swap() destroy_inode() ... RCU grace period, freed shmem_add_to_page_cache(mapping) xas_lock_irq() <- use after free swap_writeout() behaves that way if zswap is enabled, cannot take the folio and the memcg or one of its ancestors has memory.zswap.writeback set to 0. shmem_unuse() already added infrastructure to deal with that. Reuse info->stop_eviction to protect the inode during writeout. Increment it before removing the folio from the page cache, and decrement it after swap_writeout() and any attempted reinsertion and inode accounting. In shmem_evict_inode(), wait for the counter to reach zero even if swapoff has already removed the inode from the swap list. Add some helpers to make the code easier to digest. There is a known remaining issue with two swapoffs racing, and the empty list check not being able to detect that race. That will be addressed separately later. Fix generated by an LLM and sent by Josef Bacik in private. [ david: code cleanups; improve description ]

Affected and fixed versions

Package / productAffectedFixedSource
Linux>= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < d64fd1229fb1437d7c62c49eba82691bfd65d541; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < f53ee5a65460010cabd75895d83258d90923ca7a; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < 8f59173b5ca358bf4d1017b44da3cbe6faa80daf—cvelist
Linux6.17—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-139799. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-139799.md
Affected: Linux >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < d64fd1229fb1437d7c62c49eba82691bfd65d541; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < f53ee5a65460010cabd75895d83258d90923ca7a; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < 8f59173b5ca358bf4d1017b44da3cbe6faa80daf; Linux 6.17
Fixed in: Linux 8f59173b5ca358bf4d1017b44da3cbe6faa80daf

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

Technologies

References

FAQ

Is CVE-2026-139799 being exploited?

There is no confirmed exploitation: CVE-2026-139799 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

How serious is CVE-2026-139799?

High: CVSS 7.0 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2026-139799?

Linux >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < d64fd1229fb1437d7c62c49eba82691bfd65d541; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < f53ee5a65460010cabd75895d83258d90923ca7a; >= 6344a6d9ce13ae29e3ddf280fd8a1109a77b9996, < 8f59173b5ca358bf4d1017b44da3cbe6faa80daf; Linux 6.17.

Is there a fix for CVE-2026-139799?

Yes. Fixed in Linux 8f59173b5ca358bf4d1017b44da3cbe6faa80daf. Upgrade Linux to 8f59173b5ca358bf4d1017b44da3cbe6faa80daf or later.

How do I check if I'm affected by CVE-2026-139799?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

See all
Vulnerabilities, newest first
SeverityIdentifier / vulnerabilityTechnologySignalsAge
MEDIUM 6.5CVE-2026-140063

Glib2: authenticated dos via pre-emptive 128mib read-buffer allocation in gdbusworker

Linux kernel+1
MEDIUM 5.1CVE-2026-140038

Binutils: gprofng uses predictable /tmp directory with unchecked mkdir() enabling symlink-based file clobber

Linux kernel+1
HIGH 7.3CVE-2026-139801

KVM: nSVM: Check validity of vmcs01 save area copied from SMRAM on RSM

Linux kernel
UNSCOREDCVE-2026-139800

9p/xen: drain response work after unbinding IRQ

Linux kernel
UNSCOREDCVE-2026-139798

mm: do not unintentionally overwrite atomic VMA flags

Linux kernel
Sponsors