PT-2026-152530
CVE-2026-99650
·
Published
2026-11-20
·
Updated
2026-11-20
Description by
Score
N/A
Not availableNo severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
In the Linux kernel, the following vulnerability has been resolved:
mm/ksm: fix use of a freed anon vma at swap-in
A folio read from a swap slot previously shared by KSM can remain in the
swap cache after the process that first mapped it exits. Its anon vma
can then be freed, so ksm might need to copy() must not dereference it
to compare roots.
Doing so can result in some false-positives, resulting in the reverse
mapping missing the new folio mapping, preventing migration and reclaim.
SLAB TYPESAFE BY RCU allows individual anon vma objects to be reused
immediately after freeing. A stale pointer can then refer to another
anon vma whose root matches, even though the target VMA is not linked
to that anon vma.
Move the anonymous rmap compatibility checks into
folio anon rmap compatible(). Keep the page-index check and compare the
folio's anon vma pointer against the VMA's own anon vma and root first.
If neither matches, bite the bullet and walk the VMA's anon vma chain.
The VMA keeps these anon vmas alive, and finding a match guarantees that
reverse mapping can find the new mapping.
Lorenzo Stoakes says in a private discussion:
"This isn't quite equivalent to the existing check.
Every anon vma in an anon vma chain shares the same root, but if you
split a VMA then fork both of them like this:
VMA A
/ <split>
VMA B VMA C
/
root <- anon vma 1
----^ ^---- <fork>
/ parent
anon vma 2 anon vma 3
| |
VMA D VMA EVMA's D and E both get their own new
anon vma's such that:
VMA D: anon vma 2 -> anon vma 1 -> root
VMA E: anon vma 3 -> anon vma 1 -> root
And if you found a folio referencing anon vma 2, the existing check:
anon vma->root == vma->anon-vma->rootWould be true for VMA's B, C, D & E.
However after your change it'd be true for VMA D only, as it's the only
one with anon vma 2 in its anon vma chain.
Whether or not that could actually happen in practice... 🙂 I don't
know.
[...] after your change it'd be true for VMA D only, as it's the only
one with anon vma 2 in its anon vma chain. [...] I would [...] say that
you are making the test stricter but more correct.
"
If this affects performance when KSM was never even involved, we could
just track whether KSM ever merged anything and just skip these checks.
There isn't really a lot we can do otherwise: for mapped folios we might
be able to use folio get anon vma(), but for unmapped folios there really
is no easy way to see if the anon vma is still valid.
Document the (confusing) lifetime requirements of folio anon vma().
Found an issue in the description? Have something to add? Feel free to write us 👾