vfio/type1: Use follow_pte()
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 16 Feb 2021 22:49:34 +0000 (15:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:17 +0000 (11:38 +0100)
commitc2ff99488390719fd7bc44f1beba70047f939abf
tree56ed99757997bee384213e242683785e8881e6fb
parente47685ec4cb8d59f8706da532ef58b403871b534
vfio/type1: Use follow_pte()

[ Upstream commit 07956b6269d3ed05d854233d5bb776dca91751dd ]

follow_pfn() doesn't make sure that we're using the correct page
protections, get the pte with follow_pte() so that we can test
protections and get the pfn from the pte.

Fixes: 5cbf3264bc71 ("vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn()")
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vfio/vfio_iommu_type1.c