CVE-2026-89928 PUBLISHED

KVM: x86/mmu: Consume the locked rmap value in the lockless rmap walk

Assigner: Linux
Reserved: 11.09.2026 Published: 16.09.2026 Updated: 16.09.2026

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:

<pre> * 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. </pre>

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.

Metrics

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

AV:L - The UAF is reached only through local KVM: MMU notifiers on the VM mm (clear_young/clear_flush_young/test_young → kvm_age_gfn → kvm_rmap_age_gfn_range) racing with KVM_RUN shadow-MMU rmap updates. There is no network, adjacent-radio, or physical-device path. AC:L - The attacker controls both sides: KVM_RUN/nested EPT faults populate an empty rmap to KVM_RMAP_MANY and later zap it, while reclaim of the same process's guest RAM runs the lockless walker. Lockless aging is default on x86 KVM, nested=1 is default, and eliding the empty-rmap lock re-enables preemption so the TOCTOU window is large. PR:L - Exploitation requires /dev/kvm (typically kvm-group QEMU/libvirt) or a nested-capable x86 guest, not init-namespace root. KVM_CREATE_VM and KVM_RUN have no capable() check; kvm-group membership is unprivileged device access. UI:N - Once the attacker can run the VM, they drive rmap populate/zap and host aging of their own guest memory with no separate victim action such as mounting a filesystem or opening a file. S:C - The UAF runs in the host KVM MMU while walking guest/nested shadow SPTEs and frees host pte_list_desc slab objects, corrupting kernel state beyond the guest VM. That is a KVM guest-to-host escape-class boundary crossing. C:H - A writer may kmem_cache_free() the pte_list_desc chain while the lockless ager still walks it, which is a host slab use-after-free. After spray, desc->sptes[] and the subsequent SPTE reads become attacker-influenced kernel reads. I:H - kvm_rmap_age_gfn_range then clear_bit() or cmpxchg64() through the UAF-derived sptep to drop Accessed bits or mark access-track, yielding a host kernel write primitive suitable for control-flow hijacking. A:H - A slab use-after-free on pte_list_desc during the lockless walk can oops or panic the host kernel, and a malicious guest can retrigger it, denying service to the host and co-resident VMs.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from af3b6a9eba48419732b07a0472db7160282f0f39 to 41debfc98526c0a95c41a62435aca0a70340a26d (excl.)
  • affected from af3b6a9eba48419732b07a0472db7160282f0f39 to 8edb3c09e43f7cd8a5dfd291c6e0fc9c74d4621d (excl.)
  • affected from af3b6a9eba48419732b07a0472db7160282f0f39 to e428f9779a43737d830111238816f1928b07aefb (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 6.15 is affected
  • unaffected from 0 to 6.15 (excl.)
  • unaffected from 6.18.51 to 6.18.* (incl.)
  • unaffected from 7.2.5 to 7.2.* (incl.)
  • unaffected from 7.3-rc1 to * (incl.)

References