Skip to content

Commit 018cabb

Browse files
committed
Merge branch 'kvm-null-pointer-fix' into kvm-master
2 parents 997224f + 95fa101 commit 018cabb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/x86/kvm/vmx/nested.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static inline void nested_release_evmcs(struct kvm_vcpu *vcpu)
224224
return;
225225

226226
kvm_vcpu_unmap(vcpu, &vmx->nested.hv_evmcs_map, true);
227-
vmx->nested.hv_evmcs_vmptr = -1ull;
227+
vmx->nested.hv_evmcs_vmptr = 0;
228228
vmx->nested.hv_evmcs = NULL;
229229
}
230230

@@ -1923,7 +1923,8 @@ static int nested_vmx_handle_enlightened_vmptrld(struct kvm_vcpu *vcpu,
19231923
if (!nested_enlightened_vmentry(vcpu, &evmcs_gpa))
19241924
return 1;
19251925

1926-
if (unlikely(evmcs_gpa != vmx->nested.hv_evmcs_vmptr)) {
1926+
if (unlikely(!vmx->nested.hv_evmcs ||
1927+
evmcs_gpa != vmx->nested.hv_evmcs_vmptr)) {
19271928
if (!vmx->nested.hv_evmcs)
19281929
vmx->nested.current_vmptr = -1ull;
19291930

0 commit comments

Comments
 (0)