CVE-2026-99733

mm/truncate: look again if a folio left the mapping

State
Published
Severity
Not scored
Published
Nov 20, 2026
Updated
Nov 20, 2026
Reserved
Sep 25, 2026

Read the record on cve.org

Description

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

mm/truncate: look again if a folio left the mapping

invalidate_inode_pages2_range() skips a folio which no longer belongs to the mapping by the time it has got the folio lock, on the assumption that somebody else has removed it from the page cache. But the folio may have been replaced, and then there is a new folio with the same data at that index.

For most cases, like folio migration, that is impossible. However, collapse_file() only checks the refcount of the old folios, under the i_pages lock, and relies on their folio locks from there on. That works for users which repeat the lookup when they find folio->mapping changed. The following scenario is, however, possible:

CPU0 pwrite(O_DIRECT) CPU1 collapse_file() kiocb_invalidate_pages() read the folio (old data), lock it refcount check the write completes copy to new_folio kiocb_invalidate_post_direct_write() find_get_entries() -> old folio xas_store(new_folio) folio->mapping = NULL folio_unlock(folio) folio_lock() folio->mapping != mapping -> continue

In that scenario, the collapsed folio with the data from before the write stays in the page cache after the write has returned.

This used to be impossible, as khugepaged only collapsed files that nobody had open for writing.

Restart the lookup at that index, like shmem_undo_range() does. The same problem seems to exist in truncate_inode_pages_range() as well when truncate_inode_folio() fails, so handle it there as well, but slightly differently: simply check once more through find_get_entries().

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 1b6444331bebb4e586dab30b1fa0612ef482bab4 to before f17044fee422605d19e07c4c9f5dc2be7abd7086Affected
  • 1b6444331bebb4e586dab30b1fa0612ef482bab4 to before 9cf632e139737314afa889ca18122bc3fddb9120Affected
LinuxLinux
  • 7.2Affected
  • before 7.2Not affected
  • 7.3.5 through 7.3.*Not affected
  • 7.4-rc2 and laterNot affected

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.