summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/pointer_auth.h
diff options
context:
space:
mode:
authorKristina Martsenko <kristina.martsenko@arm.com>2018-12-07 18:39:28 +0000
committerWill Deacon <will.deacon@arm.com>2018-12-13 16:42:46 +0000
commitba830885656414101b2f8ca88786524d4bb5e8c1 (patch)
tree9112fbf1aee1ffcb239e5c24b767208ae0a8eec2 /arch/arm64/include/asm/pointer_auth.h
parentccc43810827f9feb5e588e4b7098dc55b1d972f8 (diff)
arm64: add prctl control for resetting ptrauth keys
Add an arm64-specific prctl to allow a thread to reinitialize its pointer authentication keys to random values. This can be useful when exec() is not used for starting new processes, to ensure that different processes still have different keys. Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/pointer_auth.h')
-rw-r--r--arch/arm64/include/asm/pointer_auth.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/pointer_auth.h b/arch/arm64/include/asm/pointer_auth.h
index 5ccf49b4dac3..80eb03afd677 100644
--- a/arch/arm64/include/asm/pointer_auth.h
+++ b/arch/arm64/include/asm/pointer_auth.h
@@ -63,6 +63,8 @@ static inline void ptrauth_keys_switch(struct ptrauth_keys *keys)
__ptrauth_key_install(APGA, keys->apga);
}
+extern int ptrauth_prctl_reset_keys(struct task_struct *tsk, unsigned long arg);
+
/*
* The EL0 pointer bits used by a pointer authentication code.
* This is dependent on TBI0 being enabled, or bits 63:56 would also apply.
@@ -86,6 +88,7 @@ do { \
ptrauth_keys_switch(&(tsk)->thread_info.keys_user)
#else /* CONFIG_ARM64_PTR_AUTH */
+#define ptrauth_prctl_reset_keys(tsk, arg) (-EINVAL)
#define ptrauth_strip_insn_pac(lr) (lr)
#define ptrauth_thread_init_user(tsk)
#define ptrauth_thread_switch(tsk)