diff options
author | Kristina Martsenko <kristina.martsenko@arm.com> | 2020-03-13 10:04:51 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2020-03-18 10:50:19 +0100 |
commit | be129842566599f2c6f8fbba277c098802cd4b3d (patch) | |
tree | 99ba6277bb813d8d239e52bfebad736d707a4080 /arch/arm64/kernel/entry.S | |
parent | arm64: rename ptrauth key structures to be user-specific (diff) | |
download | linux-be129842566599f2c6f8fbba277c098802cd4b3d.tar.xz linux-be129842566599f2c6f8fbba277c098802cd4b3d.zip |
arm64: install user ptrauth keys at kernel exit time
As we're going to enable pointer auth within the kernel and use a
different APIAKey for the kernel itself, so move the user APIAKey
switch to EL0 exception return.
The other 4 keys could remain switched during task switch, but are also
moved to keep things consistent.
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: James Morse <james.morse@arm.com>
Reviewed-by: Vincenzo Frascino <Vincenzo.Frascino@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
[Amit: commit msg, re-positioned the patch, comments]
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/entry.S')
-rw-r--r-- | arch/arm64/kernel/entry.S | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 9461d812ae27..684e475bfda0 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -14,6 +14,7 @@ #include <asm/alternative.h> #include <asm/assembler.h> #include <asm/asm-offsets.h> +#include <asm/asm_pointer_auth.h> #include <asm/cpufeature.h> #include <asm/errno.h> #include <asm/esr.h> @@ -341,6 +342,8 @@ alternative_else_nop_endif msr cntkctl_el1, x1 4: #endif + ptrauth_keys_install_user tsk, x0, x1, x2 + apply_ssbd 0, x0, x1 .endif |