Skip to content

Commit bde9f9d

Browse files
sean-jcbonzini
authored andcommitted
KVM: x86/mmu: Explicitly disallow private accesses to emulated MMIO
Explicitly detect and disallow private accesses to emulated MMIO in kvm_handle_noslot_fault() instead of relying on kvm_faultin_pfn_private() to perform the check. This will allow the page fault path to go straight to kvm_handle_noslot_fault() without bouncing through __kvm_faultin_pfn(). Signed-off-by: Sean Christopherson <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 5bd74f6 commit bde9f9d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,6 +3261,11 @@ static int kvm_handle_noslot_fault(struct kvm_vcpu *vcpu,
32613261
{
32623262
gva_t gva = fault->is_tdp ? 0 : fault->addr;
32633263

3264+
if (fault->is_private) {
3265+
kvm_mmu_prepare_memory_fault_exit(vcpu, fault);
3266+
return -EFAULT;
3267+
}
3268+
32643269
vcpu_cache_mmio_info(vcpu, gva, fault->gfn,
32653270
access & shadow_mmio_access_mask);
32663271

0 commit comments

Comments
 (0)