CVE-2026-99733: mm/truncate: look again if a folio left the mapping

Published Nov 20, 2026
·
Updated

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

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

invalidateinodepages2range() 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, collapsefile() only checks the refcount of the old folios, under the ipages 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(ODIRECT) CPU1 collapsefile() kiocbinvalidatepages() read the folio (old data), lock it refcount check the write completes copy to newfolio kiocbinvalidatepostdirectwrite() findgetentries() -> old folio xasstore(newfolio) folio->mapping = NULL foliounlock(folio) foliolock() 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 shmemundorange() does. The same problem seems to exist in truncateinodepagesrange() as well when truncateinodefolio() fails, so handle it there as well, but slightly differently: simply check once more through findgetentries().

Affected Software

3 affected componentsFixes available
linux/kernel>=7.2.0<7.3.5
7.3.5
debian/linux*
debian/linux<=7.3.4-1
6.1.176-16.1.192-26.12.107-16.12.117-17.3.5-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.5
  2. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.5-1

Event History

Nov 20, 2026
CVE Published
via MITRE·05:51 AM
Data Sourced
via MITRE·05:51 AM
Description
Data Sourced
via OSV·05:51 AM
DescriptionAffected Software
Data Sourced
via NVD·06:18 AM
Description

Frequently Asked Questions

1

What conditions are required to trigger the stale page-cache data condition?

The described race requires a direct write using pwrite(O_DIRECT) while collapse_file() is concurrently replacing folios in the same mapping. The invalidation path can lock an old folio after it has been replaced, observe that it no longer belongs to the mapping, and skip a second lookup of the replacement folio.

2

What is the practical impact of the race?

A collapsed folio containing data from before the direct write can remain in the page cache after the write completes. This can leave cached data inconsistent with the completed direct-write data.

3

Is there a workaround when the kernel fix cannot be applied immediately?

The provided information identifies the triggering combination as concurrent O_DIRECT pwrite activity and collapse_file() processing. It does not provide a documented configuration workaround or mitigation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203