CVE-2026-99918: mm/madvise: atomically clear the young bit on THP MADV_COLD

Published Nov 30, 2026
·
Updated

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

mm/madvise: atomically clear the young bit on THP MADVCOLD

As-is, madvisecoldorpageoutpterange() discards the hardware young bit by invalidating the PMD, doing pmdmkold() and subsequently writing to the pmd again. However, it does so in a racy manner, looking at a possibly-stale snapshot. It's entirely possible that a write elsewhere set the hardware D bit, which this logic now loses.

Fix it by using pmdptestandclearyoung(). This is an atomic modification of the PMD entry, and thus safe against any possible racing writes. As a (nice) side-effect, this elides one non-required TLB flush in pmdpinvalidate().

This bug can interact with the swapping system in complicated ways, leading to data loss. For instance, if a folio is marked lazyfree, but was later read from, and then MADVCOLD'd while racing a write to that same THP, dropping the dirty bit may lead to data loss as reclaim/MADVPAGEOUT drops the "clean" anon folio:

T0 T1 ================================================================ MADVFREE(thp) | folio marked lazyfree | read(thp) | PMD marked young by hardware | | MADVCOLD(thp) write(thp) | if (pmdyoung(pmd)) { PMD marked dirty by hardware | set(pmdp, pmdmkold(pmd)); MADVPAGEOUT/reclaim | dirty bit may or may not be | set | reclaim/pageout may drop | the folio |

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In madvise_cold_or_pageout_pte_range(), atomically clear the THP PMD young bit using pmdp_test_and_clear_young().

Event History

Nov 30, 2026
CVE Published
via MITRE·01:18 PM
Data Sourced
via MITRE·01:18 PM
Description

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