Message ID | 20210604172611.281819-3-jmattson@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: nVMX: Fix vmcs02 PID use-after-free issue | expand |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 882457e92679..83bc0a5b1aab 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -9471,8 +9471,8 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) static inline bool kvm_vcpu_running(struct kvm_vcpu *vcpu) { - if (is_guest_mode(vcpu)) - kvm_check_nested_events(vcpu); + if (is_guest_mode(vcpu) && kvm_check_nested_events(vcpu)) + return true; return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE && !vcpu->arch.apf.halted);