arm64: initialize ptrauth keys for kernel booting task
authorAmit Daniel Kachhap <amit.kachhap@arm.com>
Fri, 13 Mar 2020 09:04:57 +0000 (14:34 +0530)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 18 Mar 2020 09:50:20 +0000 (09:50 +0000)
commit28321582334c261c13b20d7efe634e610b4c100b
tree1a345f68e800b30309c0b710048d97dea3aecf16
parent33e45234987ea3ed4b05fc512f4441696478f12d
arm64: initialize ptrauth keys for kernel booting task

This patch uses the existing boot_init_stack_canary arch function
to initialize the ptrauth keys for the booting task in the primary
core. The requirement here is that it should be always inline and
the caller must never return.

As pointer authentication too detects a subset of stack corruption
so it makes sense to place this code here.

Both pointer authentication and stack canary codes are protected
by their respective config option.

Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Reviewed-by: Vincenzo Frascino <Vincenzo.Frascino@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/pointer_auth.h
arch/arm64/include/asm/stackprotector.h
include/linux/stackprotector.h