aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/kernel/pointer_auth.c
AgeCommit message (Collapse)AuthorFilesLines
2020-10-15arm64: reject prctl(PR_PAC_RESET_KEYS) on compat tasksPeter Collingbourne1-0/+4
It doesn't make sense to issue prctl(PR_PAC_RESET_KEYS) on a compat task because the 32-bit instruction set does not offer PAuth instructions. For consistency with other 64-bit only prctls such as {SET,GET}_TAGGED_ADDR_CTRL, reject the prctl on compat tasks. Although this is a userspace-visible change, maybe it isn't too late to make this change given that the hardware isn't available yet and it's very unlikely that anyone has 32-bit software that actually depends on this succeeding. Signed-off-by: Peter Collingbourne <[email protected]> Link: https://linux-review.googlesource.com/id/Ie885a1ff84ab498cc9f62d6451e9f2cfd4b1d06a Link: https://lore.kernel.org/r/[email protected] [will: Do the same for the SVE prctl()s] Signed-off-by: Will Deacon <[email protected]>
2020-03-18arm64: install user ptrauth keys at kernel exit timeKristina Martsenko1-3/+0
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]>
2020-03-18arm64: rename ptrauth key structures to be user-specificKristina Martsenko1-4/+4
We currently enable ptrauth for userspace, but do not use it within the kernel. We're going to enable it for the kernel, and will need to manage a separate set of ptrauth keys for the kernel. We currently keep all 5 keys in struct ptrauth_keys. However, as the kernel will only need to use 1 key, it is a bit wasteful to allocate a whole ptrauth_keys struct for every thread. Therefore, a subsequent patch will define a separate struct, with only 1 key, for the kernel. In preparation for that, rename the existing struct (and associated macros and functions) to reflect that they are specific to userspace. Acked-by: Catalin Marinas <[email protected]> Reviewed-by: Vincenzo Frascino <[email protected]> Signed-off-by: Kristina Martsenko <[email protected]> [Amit: Re-positioned the patch to reduce the diff] Signed-off-by: Amit Daniel Kachhap <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
2018-12-13arm64: ptr auth: Move per-thread keys from thread_info to thread_structWill Deacon1-1/+1
We don't need to get at the per-thread keys from assembly at all, so they can live alongside the rest of the per-thread register state in thread_struct instead of thread_info. This will also allow straighforward whitelisting of the keys for hardened usercopy should we expose them via a ptrace request later on. Signed-off-by: Will Deacon <[email protected]>
2018-12-13arm64: add prctl control for resetting ptrauth keysKristina Martsenko1-0/+47
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 <[email protected]> Signed-off-by: Will Deacon <[email protected]>