arm64: initialize and switch ptrauth kernel keys
authorKristina Martsenko <kristina.martsenko@arm.com>
Fri, 13 Mar 2020 09:04:56 +0000 (14:34 +0530)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 18 Mar 2020 09:50:20 +0000 (09:50 +0000)
commit33e45234987ea3ed4b05fc512f4441696478f12d
treee7dbf5120c409f20c20d7b095dca1244ec3f3b85
parent6982934e19f8ebb4152ba77308facdb1a38533f9
arm64: initialize and switch ptrauth kernel keys

Set up keys to use pointer authentication within the kernel. The kernel
will be compiled with APIAKey instructions, the other keys are currently
unused. Each task is given its own APIAKey, which is initialized during
fork. The key is changed during context switch and on kernel entry from
EL0.

The keys for idle threads need to be set before calling any C functions,
because it is not possible to enter and exit a function with different
keys.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Vincenzo Frascino <Vincenzo.Frascino@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
[Amit: Modified secondary cores key structure, comments]
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/asm_pointer_auth.h
arch/arm64/include/asm/pointer_auth.h
arch/arm64/include/asm/processor.h
arch/arm64/include/asm/smp.h
arch/arm64/kernel/asm-offsets.c
arch/arm64/kernel/entry.S
arch/arm64/kernel/process.c
arch/arm64/kernel/smp.c
arch/arm64/mm/proc.S