Re: [RFC v2 5/7] arm64: initialize and switch ptrauth kernel keys
From: Dave Martin <Dave.Martin@arm.com>
Date: 2019-06-04 10:03:11
On Wed, May 29, 2019 at 08:03:30PM +0100, Kristina Martsenko wrote:
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. A function that changes the key cannot return, so compile such functions without pointer auth (using __no_ptrauth which will be defined to a compiler function attribute later). Signed-off-by: Kristina Martsenko <redacted> ---
[...]
quoted hunk ↗ jump to hunk
diff --git a/arch/arm64/include/asm/pointer_auth.h b/arch/arm64/include/asm/pointer_auth.h index a97b7dc10bdb..79f35f5ecff5 100644 --- a/arch/arm64/include/asm/pointer_auth.h +++ b/arch/arm64/include/asm/pointer_auth.h@@ -25,10 +25,6 @@ struct ptrauth_key { unsigned long lo, hi; }; -/* - * We give each process its own keys, which are shared by all threads. The keys - * are inherited upon fork(), and reinitialised upon exec*(). - */ struct ptrauth_keys { struct ptrauth_key apia; struct ptrauth_key apib;@@ -37,16 +33,18 @@ struct ptrauth_keys { struct ptrauth_key apga; };
Do we need all this struct for the kernel thread case? It may be a bit pointless trying to optimise this, though. [...] Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel