# CVE-2026-99665: mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.21% (percentile 6, 2026-11-28)
- **Published:** 2026-11-20T05:50:15.647Z
- **Modified:** 2026-11-20T06:18:00.760Z

## Who should check

- Anyone running Linux \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< 0af947ae4d91af0c6e9573220a1298cd8302b6c3; \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< 1f54708f40b8dea6951426ca567fc96160693388; \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< fe2817e3d5ea347214342c9a5cd8bcbff20c0574
- Anyone running Linux 5.4

## Description

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

mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs

try\_collapse\_pte\_mapped\_thp() clears PTEs without transferring their dirty
bits to the folio. A shmem read fault can map a clean folio writable, so
a later store only dirties the PTE. Losing that dirty bit allows reclaim
to discard modified data.

The assumption that regular files are read-only is also obsolete since
commit 1b6444331bebb ("mm/khugepaged: enable clean pagecache folio collapse
for writable files"). In any case, transferring PTE dirty bits to the folio
when removing mappings (and while the folio is still mapped) is the right
thing to do.

Use get\_and\_clear\_ptes() to collect the dirty bits and mark the folio
dirty before unmapping it. Update the comment.

This was reproduced with shmem using MADV\_COLLAPSE followed by
MADV\_PAGEOUT.

Fix generated by an LLM and sent by Chris Mason in private.

\[ david: adjust comment; simplify description; cover file-thp as well \]

## Affected and fixed versions

- Linux: \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< 0af947ae4d91af0c6e9573220a1298cd8302b6c3; \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< 1f54708f40b8dea6951426ca567fc96160693388; \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< fe2817e3d5ea347214342c9a5cd8bcbff20c0574 (cvelist)
- Linux: 5.4 (cvelist)

## Technologies

Linux kernel

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-99665.md
Affected: Linux >= 27e1f8273113adec0e98bf513e4091636b27cc2a, < 0af947ae4d91af0c6e9573220a1298cd8302b6c3; >= 27e1f8273113adec0e98bf513e4091636b27cc2a, < 1f54708f40b8dea6951426ca567fc96160693388; >= 27e1f8273113adec0e98bf513e4091636b27cc2a, < fe2817e3d5ea347214342c9a5cd8bcbff20c0574; Linux 5.4
Fixed in: Linux 0af947ae4d91af0c6e9573220a1298cd8302b6c3, Linux 1f54708f40b8dea6951426ca567fc96160693388

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-99665 being exploited?

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< 0af947ae4d91af0c6e9573220a1298cd8302b6c3; \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< 1f54708f40b8dea6951426ca567fc96160693388; \>= 27e1f8273113adec0e98bf513e4091636b27cc2a, \< fe2817e3d5ea347214342c9a5cd8bcbff20c0574; Linux 5.4.

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

Yes. Fixed in Linux 0af947ae4d91af0c6e9573220a1298cd8302b6c3, Linux 1f54708f40b8dea6951426ca567fc96160693388. No fix listed yet: follow the vendor advisory.

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

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/0af947ae4d91af0c6e9573220a1298cd8302b6c3>
- other: <https://git.kernel.org/stable/c/1f54708f40b8dea6951426ca567fc96160693388>
- other: <https://git.kernel.org/stable/c/fe2817e3d5ea347214342c9a5cd8bcbff20c0574>

## 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-99665>
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

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