Skip to content

Commit 91a2c34

Browse files
Santosh ShuklaMarc Zyngier
authored andcommitted
KVM: arm64: Force PTE mapping on fault resulting in a device mapping
VFIO allows a device driver to resolve a fault by mapping a MMIO range. This can be subsequently result in user_mem_abort() to try and compute a huge mapping based on the MMIO pfn, which is a sure recipe for things to go wrong. Instead, force a PTE mapping when the pfn faulted in has a device mapping. Fixes: 6d674e2 ("KVM: arm/arm64: Properly handle faulting of device mappings") Suggested-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Santosh Shukla <sashukla@nvidia.com> [maz: rewritten commit message] Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Gavin Shan <gshan@redhat.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1603711447-11998-2-git-send-email-sashukla@nvidia.com
1 parent 2f40c46 commit 91a2c34

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/arm64/kvm/mmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
851851

852852
if (kvm_is_device_pfn(pfn)) {
853853
device = true;
854+
force_pte = true;
854855
} else if (logging_active && !write_fault) {
855856
/*
856857
* Only actually map the page as writable if this was a write

0 commit comments

Comments
 (0)