Re: [PATCH 04/35] arm64/gcs: Document the ABI for Guarded Control Stacks

From
Mike Rapoport <rppt@kernel.org>
Date
2023-07-19 14:04:56
Also in
kvmarm, linux-arch, linux-arm-kernel, linux-fsdevel, linux-kselftest, linux-mm, linux-riscv, lkml
Reply to
Mark Brown, 2023-07-19
On Wed, Jul 19, 2023 at 02:25:38PM +0100, Mark Brown wrote:
On Wed, Jul 19, 2023 at 02:44:37PM +0300, Mike Rapoport wrote:
quoted
On Sun, Jul 16, 2023 at 10:51:00PM +0100, Mark Brown wrote:
quoted
quoted
+7.  ptrace extensions
+---------------------
+
+* A new regset NT_ARM_GCS is defined for use with PTRACE_GETREGSET and
+  PTRACE_SETREGSET.
+
+* Due to the complexity surrounding allocation and deallocation of stakcs and
+  lack of practical application changes to the GCS configuration via ptrace
+  are not supported.
quoted
On x86 CRIU needed to be able to temporarily unlock shadow stack features
to recreate the shadow stack of the thread being restored. I presume CRIU
will need something like that on arm64 as well.
It would be good to understand why and what exactly is needed here.
I'm guessing the main thing would be stores? 
Yes, CRIU has to modify the shadow stack.

CRIU uses sigreturn directly, so we had to update the shadow stack before
calling sigreturn.
On x86 ptrace(POKEDATA) and update of the shadow stack pointer were enough,
but it looks like ptrace(POKEDATA) won't work on arm64.

Another place that requires shadow stack modifications is the restore of
the shadow stack from the checkpoint. On x86 we had to enable WRSS and that
required to temporarily unlock the features.
It's relatively easy to add features later, I think I'll just add support
for everything except enable just now.
Fair enough :)

-- 
Sincerely yours,
Mike.
Thread (51 messages) 51 messages, 5 authors, last reply 2023-07-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help