CVE-2026-99650
mm/ksm: fix use of a freed anon_vma at swap-in
Check your servers for CVE-2026-99650
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-99650 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
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 E
VMA'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->root
Would 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().
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.18%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 4.19% of all scored CVEs. Scores of 29 Nov 2026.
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from ba6f0ff3981e6263ab81ac512f04cca55b85ec81, before 74a05dab72662bd27ade63f6f44a2ea714815de7 affected from ba6f0ff3981e6263ab81ac512f04cca55b85ec81, before 27e31a508e4f21f2e1bbb54f8994b235fd3ee2ea affected from ba6f0ff3981e6263ab81ac512f04cca55b85ec81, before 21cc8f704b6aed33175ae22a4c467c5e8e2bdd9e affected from ba6f0ff3981e6263ab81ac512f04cca55b85ec81, before d25821a954382d13a5dd770ee5215729e8d274d7 affected from ba6f0ff3981e6263ab81ac512f04cca55b85ec81, before daa1e227f972f64a8468aa0101170fadb93ab552 affected from ba6f0ff3981e6263ab81ac512f04cca55b85ec81, before 97ce258daffd374f5403641ca892f95e31769dbb affected from ba6f0ff3981e6263ab81ac512f04cca55b85ec81, before 85260730efefc48111603fa865d224bae1f5447a affected from ba6f0ff3981e6263ab81ac512f04cca55b85ec81, before 4c2dec1dce368ad9e9b1814307cb5ef3832fa07e
Other versions: unaffected
|
| Linux |
affected 2.6.36 unaffected before 2.6.36 unaffected from 5.10.275 up to and including 5.10.* unaffected from 5.15.226 up to and including 5.15.* unaffected from 6.1.193 up to and including 6.1.* unaffected from 6.6.163 up to and including 6.6.* unaffected from 6.12.119 up to and including 6.12.* unaffected from 6.18.65 up to and including 6.18.* unaffected from 7.3.5 up to and including 7.3.* unaffected 7.4-rc2 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2026-99650 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2026-99650
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2026-99650
trivy image --scanners vuln IMAGE | grep CVE-2026-99650
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/74a05dab72662bd27ade63f6f44a2ea714815de7 git.kernel.org
- https://git.kernel.org/stable/c/27e31a508e4f21f2e1bbb54f8994b235fd3ee2ea git.kernel.org
- https://git.kernel.org/stable/c/21cc8f704b6aed33175ae22a4c467c5e8e2bdd9e git.kernel.org
- https://git.kernel.org/stable/c/d25821a954382d13a5dd770ee5215729e8d274d7 git.kernel.org
- https://git.kernel.org/stable/c/daa1e227f972f64a8468aa0101170fadb93ab552 git.kernel.org
- https://git.kernel.org/stable/c/97ce258daffd374f5403641ca892f95e31769dbb git.kernel.org
- https://git.kernel.org/stable/c/85260730efefc48111603fa865d224bae1f5447a git.kernel.org
- https://git.kernel.org/stable/c/4c2dec1dce368ad9e9b1814307cb5ef3832fa07e git.kernel.org
Source: the record CVE-2026-99650 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse