mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-02 20:29:20 +00:00
KVM: nVMX: Release eVMCS when enlightened VMENTRY was disabled
In theory, L1 can try to disable enlightened VMENTRY in VP assist page and try to issue VMLAUNCH/VMRESUME. While nested_vmx_handle_enlightened_vmptrld() properly handles this as 'EVMPTRLD_DISABLED', previously mapped eVMCS remains mapped and thus all evmptr_is_valid() checks will still pass and nested_vmx_run() will proceed when it shouldn't. Release eVMCS immediately when we detect that enlightened vmentry was disabled by L1. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20210526132026.270394-4-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6a789ca5d5
commit
0276171680
1 changed files with 3 additions and 1 deletions
|
@ -1979,8 +1979,10 @@ static enum nested_evmptrld_status nested_vmx_handle_enlightened_vmptrld(
|
|||
if (likely(!vmx->nested.enlightened_vmcs_enabled))
|
||||
return EVMPTRLD_DISABLED;
|
||||
|
||||
if (!nested_enlightened_vmentry(vcpu, &evmcs_gpa))
|
||||
if (!nested_enlightened_vmentry(vcpu, &evmcs_gpa)) {
|
||||
nested_release_evmcs(vcpu);
|
||||
return EVMPTRLD_DISABLED;
|
||||
}
|
||||
|
||||
if (unlikely(evmcs_gpa != vmx->nested.hv_evmcs_vmptr)) {
|
||||
vmx->nested.current_vmptr = -1ull;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue