CVE-2026-99334: KVM: PPC: Book3S HV: Add preempt_disable() around virtual-mode HPTE bit-lock users
In the Linux kernel, the following vulnerability has been resolved:
KVM: PPC: Book3S HV: Add preemptdisable() around virtual-mode HPTE bit-lock users
kvmppchvfindlockhpte() requires virtual-mode callers to run with preemption disabled, because it can return with HPTEVHVLOCK still held until the caller later unlocks the HPTE. Existing virtual-mode callers in book3s64mmuhv.c already follow that rule.
Two virtual-mode call paths do not:
1. kvmppchandleexithv() calls kvmppchptehvfault() for hash-mode data-side and instruction-side faults after guest exit, with preemption already enabled. kvmppchptehvfault() calls kvmppchvfindlockhpte() directly.
2. kvmppcpseriesdohcall() executes virtual-mode handlers for HPT hcalls via kvmppcpseriesdohpthcall() with preemption enabled. The handlers for HENTER, HREMOVE, HREAD, HCLEARMOD, HCLEARREF, HPROTECT, and HBULKREMOVE spin on trylockhpte() or lockrmap(), and HENTER also reaches kvmppcdohenter(), which uses archspinlock() on kvm->mmulock. That raw lock choice is intentional because kvmppcdohenter() is also used by real-mode callers, so the correct fix is to establish the proper preemption context at the virtual-mode caller boundary.
If a vCPU thread is preempted while holding HPTEVHVLOCK, any other thread on the same CPU trying to acquire the same bit-lock can spin indefinitely. The same applies to lockrmap() users and to the HENTER path while holding the raw mmulock.
Fix this by adding preemptdisable()/preemptenable() pairs around the two kvmppchptehvfault() call sites in kvmppchandleexithv(), and around the kvmppcpseriesdohpthcall() invocation in kvmppcpseriesdohcall(). Targeting only the HPT hcall helper avoids wrapping non-HPT hcalls (such as HRTAS, HCONFER, HREGISTERVPA) that perform page faults, blocking memory allocations, or context switches.
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In virtual-mode callers, add preempt_disable()/preempt_enable() pairs around HPT operations that use HPTE bit-locks, including the H_PROTECT and H_BULK_REMOVE paths; establish the preemption-disabled context at the caller boundary.