KernelScan.io

HIGH Introduced in 6.15

kvm LocklessRmap UAF

CVE-2026-89928

CVSS 8.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

KernelScan AI7.7HIGH

01

In the Linux kernel, the following vulnerability has been resolved: KVM: x86/mmu: Consume the locked rmap value in the lockless rmap walk __kvm_rmap_lock() deliberately elides the rmap lock when it observes an empty rmap. In that case kvm_rmap_lock_readonly() also re-enables preemption and returns zero, so the caller holds neither the rmap lock nor a preemption reference. The elision documents the invariant it relies on: * Elide the lock if the rmap is empty, as lockless walkers (read-only * mode) don't need to (and can't) walk an empty rmap, nor can they add * entries to the rmap. I.e. the only paths that process empty rmaps * do so while holding mmu_lock for write, and are mutually exclusive. kvm_rmap_age_gfn_range() ignores the returned value and unconditionally enters for_each_rmap_spte_lockless(). The iterator started with rmap_get_first(), which re-reads rmap_head->val rather than using the value returned by the lock. If a writer populates the rmap between the lock's read and the iterator's re-read, the aging path walks the newly installed rmap without holding its lock. For a KVM_RMAP_MANY rmap this leaves the walker following a pte_list_desc chain that it never locked. A writer holding mmu_lock for write may free that chain (e.g. kvm_zap_all_rmap_sptes() on the recycle path, or any rmap zap) via kmem_cache_free() while the walk is in progress, giving a slab use-after-free. Nothing serialises the two: the aging path runs without mmu_lock when CONFIG_KVM_MMU_LOCKLESS_AGING=y, and the rmap lock that would otherwise exclude the writer was elided. Because the empty path re-enables preemption, the interval between the two reads can span an arbitrary scheduling delay. Fix the class of bug by having the lockless walk consume the value returned by the lock instead of re-reading the rmap. Split rmap_get_first() into __rmap_get_first(), which starts an iterator from an already-read rmap value, and make for_each_rmap_spte_lockless() take that value and call __rmap_get_first() directly. kvm_rmap_age_gfn_range() passes the value returned by kvm_rmap_lock_readonly(): when the lock was elided the value is zero, __rmap_get_first() returns NULL, and the walk is skipped. No lockless walker re-reads the rmap, so the lock-elision invariant cannot be violated, and no lock()-without-paired-unlock() path is added to the aging code.

02

Engine v0.6.0

Risk summary

A malicious guest VM on a KVM host with lockless rmap aging enabled can trigger a use-after-free in the host kernel by racing the memory aging path against rmap population and teardown. This can lead to host kernel memory corruption, potentially allowing guest-to-host escape with arbitrary read/write capabilities. The vulnerability requires the kernel config option CONFIG_KVM_MMU_LOCKLESS_AGING to be enabled and a guest VM to be running on the host.

Affectedarch/x86/kvm/mmu/mmu.c (KVM x86 MMU)

Vulnerability analysis

A memory-aging optimization in the host kernel's virtualization subsystem skips locking when a guest memory map is empty. The aging routine ignored this signal and rechecked the map before walking it, leaving a race window. A concurrent update could fill the map and then tear down its backing data while the aging path was still traversing it, causing a use-after-free in the host kernel. The fix uses the same snapshot from the initial check for the entire walk, skipping it safely when the map is empty so the race cannot happen. A malicious guest can reach this through ordinary memory activity on a host with lockless memory aging enabled, without needing privileges on the host itself.

03

BranchIntroducedFixed inPatch commit
6.186.156.18.5141debfc98526
7.26.157.2.58edb3c09e43f
mainline6.157.3-rc1e428f9779a43