path: root/drivers
diff options
authorAndrey Konovalov <>2019-09-25 16:49:01 -0700
committerLinus Torvalds <>2019-09-25 17:51:41 -0700
commit6cf5354c1c4b74fd2e5527db084f163e9d4dae4e (patch)
tree6f521d9fa7051a2c8055f7d97a55c8bbbc65407f /drivers
parent78063a9dd9637c0450cf6eacc03f42eb1295917f (diff)
vfio/type1: untag user pointers in vaddr_get_pfn
This patch is a part of a series that extends kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. vaddr_get_pfn() uses provided user pointers for vma lookups, which can only by done with untagged pointers. Untag user pointers in this function. Link: Signed-off-by: Andrey Konovalov <> Reviewed-by: Eric Auger <> Reviewed-by: Vincenzo Frascino <> Reviewed-by: Catalin Marinas <> Reviewed-by: Kees Cook <> Cc: Dave Hansen <> Cc: Will Deacon <> Cc: Al Viro <> Cc: Felix Kuehling <> Cc: Jens Wiklander <> Cc: Khalid Aziz <> Cc: Mauro Carvalho Chehab <> Cc: Mike Rapoport <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'drivers')
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 9a50b0558fa9..96fddc1dafc3 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -375,6 +375,8 @@ static int vaddr_get_pfn(struct mm_struct *mm, unsigned long vaddr,
+ vaddr = untagged_addr(vaddr);
vma = find_vma_intersection(mm, vaddr, vaddr + 1);
if (vma && vma->vm_flags & VM_PFNMAP) {