Skip to content

Commit 36d4492

Browse files
sean-jcbonzini
authored andcommitted
KVM: x86/mmu: Set kvm_page_fault.hva to KVM_HVA_ERR_BAD for "no slot" faults
Explicitly set fault->hva to KVM_HVA_ERR_BAD when handling a "no slot" fault to ensure that KVM doesn't use a bogus virtual address, e.g. if there *was* a slot but it's unusable (APIC access page), or if there really was no slot, in which case fault->hva will be '0' (which is a legal address for x86). Signed-off-by: Sean Christopherson <[email protected]> Reviewed-by: Kai Huang <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent f6adeae commit 36d4492

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,6 +3272,7 @@ static int kvm_handle_noslot_fault(struct kvm_vcpu *vcpu,
32723272
fault->slot = NULL;
32733273
fault->pfn = KVM_PFN_NOSLOT;
32743274
fault->map_writable = false;
3275+
fault->hva = KVM_HVA_ERR_BAD;
32753276

32763277
/*
32773278
* If MMIO caching is disabled, emulate immediately without

0 commit comments

Comments
 (0)