arm64: Introduce prctl() options to control the tagged user addresses ABI
authorCatalin Marinas <catalin.marinas@arm.com>
Tue, 23 Jul 2019 17:58:39 +0000 (19:58 +0200)
committerWill Deacon <will@kernel.org>
Tue, 6 Aug 2019 17:08:45 +0000 (18:08 +0100)
commit63f0c60379650d82250f22e4cf4137ef3dc4f43d
treeaf76cdc5d0eeca023d86c43664d073af25d63546
parent2b835e24b5c6f9c633ff51973581ee7ca7b3e8ec
arm64: Introduce prctl() options to control the tagged user addresses ABI

It is not desirable to relax the ABI to allow tagged user addresses into
the kernel indiscriminately. This patch introduces a prctl() interface
for enabling or disabling the tagged ABI with a global sysctl control
for preventing applications from enabling the relaxed ABI (meant for
testing user-space prctl() return error checking without reconfiguring
the kernel). The ABI properties are inherited by threads of the same
application and fork()'ed children but cleared on execve(). A Kconfig
option allows the overall disabling of the relaxed ABI.

The PR_SET_TAGGED_ADDR_CTRL will be expanded in the future to handle
MTE-specific settings like imprecise vs precise exceptions.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/Kconfig
arch/arm64/include/asm/processor.h
arch/arm64/include/asm/thread_info.h
arch/arm64/include/asm/uaccess.h
arch/arm64/kernel/process.c
include/uapi/linux/prctl.h
kernel/sys.c