CVE-2026-99656: mm/madvise: fix data loss from MADV_FREE on a KSM page

Published Nov 20, 2026

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

mm/madvise: fix data loss from MADVFREE on a KSM page

MADVFREE can clear the dirty flag of a singly mapped KSM folio. The folio remains in the stable tree and can gain new mappings without being dirtied again. Once marked lazyfree, reclaim can discard data that those mappings still need.

KSM always marks a folio dirty when converting it to a KSM folio in trytomergeonepage(). Marking a folio lazyfree clears PGswapbacked but leaves PGdirty unchanged. Preserving PGdirty makes reclaim restore PGswapbacked instead of discarding the folio. This also protects folios that were already lazyfree when KSM converted them.

Skip KSM folios before clearing their dirty flag, checking under the folio lock to serialize with KSM conversion.

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 6.12.118
  2. Upgrade

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

    Fixed in 6.18.64
  3. Upgrade

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

    Fixed in 7.3.5

Frequently Asked Questions

1

What workload conditions can trigger the data loss?

The issue requires a KSM folio that is singly mapped and then processed with MADV_FREE. If the folio remains in KSM’s stable tree, it can acquire new mappings while its dirty state has been cleared, allowing reclaim to discard data still needed by those mappings.

2

What should be done if the kernel update cannot be applied immediately?

The provided information identifies MADV_FREE on KSM folios as the triggering condition. Avoid combining MADV_FREE with KSM-managed memory until an update containing the fix can be deployed.

3

How does the fix prevent reclamation of needed data?

It skips KSM folios before MADV_FREE clears their dirty flag, with the check performed under the folio lock to serialize against KSM conversion. Keeping the folio dirty causes reclaim to restore its swap-backed state rather than discard it.

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