All vulnerabilities

Servers and applications

CVE-2026-99739

mm/shmem: fix truncate hang in large swap entry

Severity
Unrated
Published
20 Nov 2026
Last changed
20 Nov 2026
Added to UpHeron
20 Nov 2026
Fixed in
6.12.118, 6.18.64, 7.3.5
Sources
CVE Program

Description

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

Truncating a tmpfs file or memfd to a page-aligned size inside a large swap entry can loop indefinitely in shmem_undo_range(). The task holds the inode lock and cannot be killed.

A large swap entry represents a whole swapped-out folio. For example, truncate a file whose pages 0-7 share one swap entry to four pages:

[ 0 1 2 3 | 4 5 6 7 ] keep | discard ^ new EOF, start = 4

i_size has already been updated when boundary handling asks shmem_get_partial_folio() for page 4. Since it is swapped out, the helper calls shmem_get_folio() with SGP_READ. That rejects page 4 with -EINVAL because its starting offset equals i_size. Nothing is read back.

The final scan cannot free the entry without losing pages 0-3. It skips it, restarts from start = 4, and finds it again indefinitely. An unaligned truncate avoids this particular failure because the requested page starts below i_size.

From the CVE Program. Shortened; the full text is there.

Affected software

SoftwareAffected versions
Linux kernelServers and applications · cna:linux|linux
  • From 6.12.69 before 6.12.118
  • From 6.13 before 6.18.64
  • From 6.18.9 before 6.18.64
  • From 6.19 before 6.12.118
  • From 7 before 7.3.5

About Linux kernel

Unix-like operating system kernel, basis for all Linux operating systems

From Wikidata, CC0 1.0.
GitHub stars
255,726GitHub, 15 Nov 2026
Forks
67,394GitHub, 15 Nov 2026
Developer
Linus TorvaldsWikidata
License
GNU General Public License, version 2.0Wikidata
Written in
CWikidata
First released
25 Aug 1991Wikidata
First published on GitHub
4 Sept 2011GitHub

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-99739