userfaultfd: untag user pointers

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.

userfaultfd code use provided user pointers for vma lookups, which can
only by done with untagged pointers.

Untag user pointers in validate_range().

Signed-off-by: Andrey Konovalov <>
Reviewed-by: Mike Rapoport <>
Reviewed-by: Vincenzo Frascino <>
Reviewed-by: Catalin Marinas <>
Reviewed-by: Kees Cook <>
Cc: Al Viro <>
Cc: Dave Hansen <>
Cc: Eric Auger <>
Cc: Felix Kuehling <>
Cc: Jens Wiklander <>
Cc: Khalid Aziz <>
Cc: Mauro Carvalho Chehab <>
Cc: Will Deacon <>
Signed-off-by: Andrew Morton <>
1 file changed