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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.19% (percentile 5, 2026-11-26)
- **Published:** 2026-08-10T11:51:40.304Z
- **Modified:** 2026-11-06T17:19:17.237Z

## Who should check

- Anyone running Linux \>= 99cb0dbd47a15d395bf3faa78dc122bc5efe3fc0, \< 2dfe9f5c91d0963058f8a5e46e1c2a908382cc46
- Anyone running Linux 5.4

## Description

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 filemap\_nr\_thps\*() 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(O\_RDWR/O\_WRONLY), the page cache for that
particular file is dropped. This is fine because nothing could've been
dirtied.

However, there is an edge-case: collapse\_file() 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, O\_RDWR)
write(file)
close(file)
madvise(file\_mapping, MADV\_COLLAPSE, some non-dirty range)
open(file, O\_RDWR)
 nr\_thps \> 0
  truncate\_inode\_pages()
    /\* 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
invalidate\_lock needs to be held while doing the writeout, so that
do\_dentry\_open()'s page cache truncation excludes this write-and-wait.

As a side effect, move the nr\_thps counter bumping outside the i\_pages
lock. This is correct since the counter itself is an atomic\_t and the
producer \<-\> consumer correctness is provided by a full memory barrier:
smp\_mb() in collapse\_file()/memory barrier implied by full ordering in
get\_write\_access() -\> atomic\_inc\_unless\_negative().

## Affected and fixed versions

- Linux: \>= 99cb0dbd47a15d395bf3faa78dc122bc5efe3fc0, \< 2dfe9f5c91d0963058f8a5e46e1c2a908382cc46 (cvelist)
- Linux: 5.4 (cvelist)

## Mitigation

- Upgrade Linux to 2dfe9f5c91d0963058f8a5e46e1c2a908382cc46 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-68086.md
Affected: Linux >= 99cb0dbd47a15d395bf3faa78dc122bc5efe3fc0, < 2dfe9f5c91d0963058f8a5e46e1c2a908382cc46; Linux 5.4
Fixed in: Linux 2dfe9f5c91d0963058f8a5e46e1c2a908382cc46

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.
```

## FAQ

### Is CVE-2026-68086 being exploited?

There is no confirmed exploitation: CVE-2026-68086 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.19% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-68086?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-68086?

Linux \>= 99cb0dbd47a15d395bf3faa78dc122bc5efe3fc0, \< 2dfe9f5c91d0963058f8a5e46e1c2a908382cc46; Linux 5.4.

### Is there a fix for CVE-2026-68086?

Yes. Fixed in Linux 2dfe9f5c91d0963058f8a5e46e1c2a908382cc46. Upgrade Linux to 2dfe9f5c91d0963058f8a5e46e1c2a908382cc46 or later.

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

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.

## References

- other: <https://git.kernel.org/stable/c/2dfe9f5c91d0963058f8a5e46e1c2a908382cc46>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-68086>

HTML: <https://flawdb.com/CVE-2026-68086> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-68086>
