KVM: arm64: nv: Fix SPSR_EL2 restore in kvm_hyp_handle_mops()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
KVM: arm64: nv: Fix SPSR_EL2 restore in kvm_hyp_handle_mops()
kvm_hyp_handle_mops() resets the single-step state machine as part of rewinding state for a MOPS exception by modifying vcpu_cpsr() and writing the result directly into hardware.
In the case of nested virtualization, vcpu_cpsr() is a synthetic value such that the rest of KVM can deal with vEL2 cleanly. That means the value requires translation before being written into hardware, which is unfortunately missing from the MOPS handler.
Fix it by directly modifying SPSR_EL2 and avoiding the synthetic state altogether, which will be resynchronized on the next 'full' exit back to KVM.
From the CVE record · Linux
The Linux kernel’s KVM arm64 MOPS handler can restore SPSR_EL2 incorrectly when a MOPS exception occurs during nested virtualization. It writes a synthetic state value directly to hardware without the required translation. The input does not specify an attacker-controlled outcome, authentication requirements, or user interaction.
Engineers running Linux kernel KVM on arm64 with nested virtualization should check their kernels; affected versions are not specified.