CVE-2026-99471: KVM: PPC: Book3S HV: Add SRCU protection for virtual-mode HPT hcalls
In the Linux kernel, the following vulnerability has been resolved:
KVM: PPC: Book3S HV: Add SRCU protection for virtual-mode HPT hcalls
The virtual-mode HPT hcall handlers (HENTER, HREMOVE, HBULKREMOVE, HCLEARREF, HCLEARMOD) call into book3shvrmmmu.c, which accesses memslots via kvmmemslotsraw(). kvmmemslotsraw() uses rcudereferencerawcheck() to bypass SRCU lockdep annotation checking. This is safe in real mode because the entire guest entry/exit is wrapped in srcureadlock/unlock inside kvmppcruncore() and kvmhvrunsinglevcpu().
However, since commit 6165d5dd99db ("KVM: PPC: Book3S HV: add virtual mode handlers for HPT hcalls and page faults"), these same handlers are also executed in virtual mode via kvmppcpseriesdohcall(), which runs after SRCU has already been released on guest exit.
A concurrent KVMSETUSERMEMORYREGION deletion or move can therefore call synchronizesrcuexpedited() — which does not wait for this thread — and then kfree(slot) and vfree(slot->arch.rmap) while the hcall handler still holds a raw pointer to the memslot. lockrmap() then writes to freed vmalloc memory, leading to use-after-free and memory corruption. Because kvmmemslotsraw() suppresses lockdep checks, this race is entirely silent.
Fix this by factoring out the 7 HPT hcall handlers (HREMOVE, HENTER, HREAD, HCLEARMOD, HCLEARREF, HPROTECT, HBULKREMOVE) into a helper function, kvmppcpseriesdohpthcall(), and wrapping its call site in srcureadlock(&kvm->srcu) / srcureadunlock(&kvm->srcu, idx). Targeting only the HPT hcalls avoids wrapping non-HPT hcalls that sleep (such as HCONFER, HREGISTERVPA, HPAGEINIT) or handlers that already acquire SRCU internally (such as HRTAS).
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Compensating control
Factor the virtual-mode HPT hcall handlers (H_REMOVE, H_ENTER, H_BULK_REMOVE, H_READ, H_CLEAR_MOD, H_CLEAR_REF, and H_PROTECT) into kvmppc_pseries_do_hpt_hcall(), and wrap its call with srcu_read_lock()/srcu_read_unlock() in kvmppc_run_core() and kvmhv_run_single_vcpu().