CVE-2026-99651: mm/ksm: reset the unstable trees of all nodes

Published Nov 20, 2026
·
Updated

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

mm/ksm: reset the unstable trees of all nodes

Each full scan resets ksmnrnodeids unstable tree roots. Enabling mergeacrossnodes resets this count to 1, even if per-node roots were previously allocated.

So when toggling "mergeacrossnodes" 0 -> 1 -> 0, a scan that starts while the setting is 1 and continues after switching back to 0 can encounter stale unstable tree roots, resulting in UAF.

Only root is allowed to change "mergeacrossnodes", and the documented sequence is: "mergeacrossnodes setting can be changed only when there are no ksm shared pages in the system: set run 2 to unmerge pages first, then to 1 after changing mergeacrossnodes, to remerge according to the new setting."

Let's fix it by tracking in ksmnrnodeids the actual number of allocated tree roots.

removeallstablenodes() and ksmcheckstabletree() will now scan more tree roots (skipping the empty ones), which is harmless.

Affected Software

3 affected componentsFixes available
linux/kernel>=3.9.0<6.12.118
6.12.118
linux/kernel>=6.13.0<6.18.64
6.18.64
linux/kernel>=6.19.0<7.3.5
7.3.5

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
  4. Configuration

    Change merge_across_nodes only when there are no KSM-shared pages: set run to 2 to unmerge pages, change merge_across_nodes, then set run to 1 to remerge pages under the new setting.

    Linux kernel KSM merge_across_nodes

Frequently Asked Questions

1

Who can trigger the vulnerable state?

Only root can change the merge_across_nodes setting. Exploitation requires toggling it from 0 to 1 and back to 0 while a KSM full scan begins with the setting enabled and continues after it is disabled.

2

Is following the documented configuration-change procedure relevant?

Yes. The documented procedure requires unmerging KSM pages by setting run to 2 before changing merge_across_nodes, then setting run back to 1 afterward so pages are remerged under the new setting.

3

What condition indicates a system may be exposed?

A system may be exposed if merge_across_nodes was changed through the 0 -> 1 -> 0 sequence while KSM scanning was active, allowing the scan to encounter stale per-node unstable-tree roots and cause a use-after-free.

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