aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/kernel/pointer_auth.c
diff options
context:
space:
mode:
authorKristina Martsenko <[email protected]>2020-03-13 14:34:51 +0530
committerCatalin Marinas <[email protected]>2020-03-18 09:50:19 +0000
commitbe129842566599f2c6f8fbba277c098802cd4b3d (patch)
tree99ba6277bb813d8d239e52bfebad736d707a4080 /arch/arm64/kernel/pointer_auth.c
parent91a1b6ccff323e60615e3118eceb2d8cbc4f69ab (diff)
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 <[email protected]> Reviewed-by: James Morse <[email protected]> Reviewed-by: Vincenzo Frascino <[email protected]> Signed-off-by: Kristina Martsenko <[email protected]> [Amit: commit msg, re-positioned the patch, comments] Signed-off-by: Amit Daniel Kachhap <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'arch/arm64/kernel/pointer_auth.c')
-rw-r--r--arch/arm64/kernel/pointer_auth.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/arch/arm64/kernel/pointer_auth.c b/arch/arm64/kernel/pointer_auth.c
index af5a638207f8..1e77736a4f66 100644
--- a/arch/arm64/kernel/pointer_auth.c
+++ b/arch/arm64/kernel/pointer_auth.c
@@ -19,7 +19,6 @@ int ptrauth_prctl_reset_keys(struct task_struct *tsk, unsigned long arg)
if (!arg) {
ptrauth_keys_init_user(keys);
- ptrauth_keys_switch_user(keys);
return 0;
}
@@ -41,7 +40,5 @@ int ptrauth_prctl_reset_keys(struct task_struct *tsk, unsigned long arg)
if (arg & PR_PAC_APGAKEY)
get_random_bytes(&keys->apga, sizeof(keys->apga));
- ptrauth_keys_switch_user(keys);
-
return 0;
}