Skip to content

Commit ca64705

Browse files
Sukrit Bhatnagarjfvogel
authored andcommitted
KVM: VMX: Fix check for valid GVA on an EPT violation
[ Upstream commit d0164c161923ac303bd843e04ebe95cfd03c6e19 ] On an EPT violation, bit 7 of the exit qualification is set if the guest linear-address is valid. The derived page fault error code should not be checked for this bit. Fixes: f300948 ("KVM: VMX: Set PFERR_GUEST_{FINAL,PAGE}_MASK if and only if the GVA is valid") Cc: stable@vger.kernel.org Signed-off-by: Sukrit Bhatnagar <Sukrit.Bhatnagar@sony.com> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Link: https://patch.msgid.link/20251106052853.3071088-1-Sukrit.Bhatnagar@sony.com Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 3010739f53438b87216d4c04b19f8139cf44e40b) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
1 parent 748bf53 commit ca64705

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/vmx/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static inline int __vmx_handle_ept_violation(struct kvm_vcpu *vcpu, gpa_t gpa,
2424
error_code |= (exit_qualification & EPT_VIOLATION_RWX_MASK)
2525
? PFERR_PRESENT_MASK : 0;
2626

27-
if (error_code & EPT_VIOLATION_GVA_IS_VALID)
27+
if (exit_qualification & EPT_VIOLATION_GVA_IS_VALID)
2828
error_code |= (exit_qualification & EPT_VIOLATION_GVA_TRANSLATED) ?
2929
PFERR_GUEST_FINAL_MASK : PFERR_GUEST_PAGE_MASK;
3030

0 commit comments

Comments
 (0)