]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Force PTE mapping on fault resulting in a device mapping
authorSantosh Shukla <sashukla@nvidia.com>
Mon, 26 Oct 2020 11:24:07 +0000 (16:54 +0530)
committerMarc Zyngier <maz@kernel.org>
Thu, 29 Oct 2020 20:41:04 +0000 (20:41 +0000)
commit7e62b58f298a3641b8ab55966b1ecad375f6d8ea
treeaf2a3c98477885147558233c175d6368ef24c77d
parent949917c7b080953baa12b4459466b43ec7771fea
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: e81c86961e66 ("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
arch/arm64/kvm/mmu.c