fs/namespace: untag user pointers in copy_mount_options
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.
In copy_mount_options a user address is being subtracted from TASK_SIZE.
If the address is lower than TASK_SIZE, the size is calculated to not
allow the exact_copy_from_user() call to cross TASK_SIZE boundary.
However if the address is tagged, then the size will be calculated
Untag the address before subtracting.
Signed-off-by: Andrey Konovalov <email@example.com>
Reviewed-by: Khalid Aziz <firstname.lastname@example.org>
Reviewed-by: Vincenzo Frascino <email@example.com>
Reviewed-by: Kees Cook <firstname.lastname@example.org>
Reviewed-by: Catalin Marinas <email@example.com>
Cc: Al Viro <firstname.lastname@example.org>
Cc: Dave Hansen <email@example.com>
Cc: Eric Auger <firstname.lastname@example.org>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Jens Wiklander <email@example.com>
Cc: Mauro Carvalho Chehab <firstname.lastname@example.org>
Cc: Mike Rapoport <email@example.com>
Cc: Will Deacon <firstname.lastname@example.org>
Signed-off-by: Andrew Morton <email@example.com>
1 file changed