CVE-2026-68086: mm/khugepaged: write all dirty file folios when collapsing

Published Aug 10, 2026
·
Updated

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

mm/khugepaged: write all dirty file folios when collapsing

[There is no upstream commit, as this code was removed by upstream commit 044925f9b565 ("mm: fs: remove filemapnrthps() functions and their users")]

As-is, khugepaged and writable-file opening exclude each other. A file cannot be open writeable and have THPs (because the filesystem is not aware of them). khugepaged will never collapse file pages for files that are opened writeable. On an open(ORDWR/OWRONLY), the page cache for that particular file is dropped. This is fine because nothing could've been dirtied.

However, there is an edge-case: collapsefile() might not be able to coexist with concurrent writers, but it can coexist with dirty folios (from previous writers). Therefore, the following can happen:

open(file, ORDWR) write(file) close(file) madvise(filemapping, MADVCOLLAPSE, some non-dirty range) open(file, ORDWR) nrthps > 0 truncateinodepages() / THPs are cleared out, but so are the dirty folios /

When this edge-case happens, there is data loss, as the dirty folios are fully discarded.

Fix it by fully writing back the page cache (and waiting) when collapsing file THPs. Doing so provides the guarantee that no dirty folio will be observed while there are active THPs. To fully ensure this is safe, the invalidatelock needs to be held while doing the writeout, so that dodentryopen()'s page cache truncation excludes this write-and-wait.

As a side effect, move the nrthps counter bumping outside the ipages lock. This is correct since the counter itself is an atomict and the producer <-> consumer correctness is provided by a full memory barrier: smpmb() in collapsefile()/memory barrier implied by full ordering in getwriteaccess() -> atomicincunlessnegative().

Affected Software

1 affected component
Linux Kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch 044925f9b565
  2. Configuration

    Update the kernel so that khugepaged, during THP collapsing, writes back all dirty file folios and waits (as described: "mm/khugepaged: write all dirty file folios when collapsing"), instead of allowing dirty folios to be discarded while THPs are collapsed.

    Linux kernel (mm/khugepaged) write all dirty file folios when collapsing THPs = enabled
  3. Compensating control

    Ensure the kernel writeout/invalidate synchronization used in the fix is preserved: hold invalidate_lock while performing the writeout so khugepaged will never collapse file pages for files that are concurrently writable by open(O_RDWR/O_WRONLY).

Event History

Aug 10, 2026
CVE Published
via MITRE·11:51 AM
Data Sourced
via MITRE·11:51 AM
Description
Data Sourced
via NVD·12:17 PM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-68086?

The severity of CVE-2026-68086 is rated at risk 46.

2

How do I fix CVE-2026-68086?

To fix CVE-2026-68086, ensure that your Linux kernel is updated to a version that includes the removal of the vulnerable functions.

3

Which software is affected by CVE-2026-68086?

CVE-2026-68086 affects the Linux Kernel.

4

What does CVE-2026-68086 impact in the Linux kernel?

CVE-2026-68086 impacts the khugepaged functionality related to handling dirty file folios.

5

Is there an upstream commit for CVE-2026-68086?

There is no upstream commit for CVE-2026-68086 as the affected code has been removed by a previous commit.

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