]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:21:59 +0000 (19:21 +0100)
commitbf375d7cd302856c76d40b9a569a278e7fe9781e
treed80230f83607c830e4e60f4a90f93b88f60ed822
parent97bfb92dd970f5b9049b461e6722be4ecd4f11db
KVM: arm64: Force PTE mapping on fault resulting in a device mapping

[ Upstream commit 91a2c34b7d6fadc9c5d9433c620ea4c32ee7cae8 ]

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: 6d674e28f642 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kvm/mmu.c