Thread (87 messages) 87 messages, 4 authors, 2023-10-19

Re: [PATCH v4 03/36] arm64/gcs: Document the ABI for Guarded Control Stacks

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2023-08-18 17:31:07
Also in: kvmarm, linux-arch, linux-doc, linux-fsdevel, linux-kselftest, linux-mm, linux-riscv, lkml

On Wed, Aug 09, 2023 at 04:34:38PM +0100, Mark Brown wrote:
On Wed, Aug 09, 2023 at 03:24:14PM +0100, Catalin Marinas wrote:
quoted
On Mon, Aug 07, 2023 at 11:00:08PM +0100, Mark Brown wrote:
quoted
+* When set PR_SHADOW_STACK_ENABLE flag allocates a Guarded Control Stack for
The 'for' at the end of the line above is not needed.
quoted
+  and enables GCS for the thread, enabling the functionality controlled by
I find it a little clearer that it's a per thread stack here but sure.
If it reads better for you, feel free to keep it as is.
quoted
quoted
+3.  Allocation of Guarded Control Stacks
+----------------------------------------
quoted
quoted
+* When GCS is enabled for a thread a new Guarded Control Stack will be
+  allocated for it of size RLIMIT_STACK / 2 or 2 gigabytes, whichever is
+  smaller.
quoted
Is this number based on the fact that a function call would only push
the LR to GCS while standard function prologue pushes at least two
registers?
It's actually based on bitrot that I'd initially chosen a smaller value
since it's likely that functions will push at least something as you
suggest, the patches now just use RLIMIT_STACK.  I'll fix.
A related question - it may have been discussed intensively on the x86
thread (I may read it sometime) - why not have the libc map the shadow
stack and pass the pointer/size to clone3()? It saves us from having to
guess what the right size we'd need. struct clone_args is extensible.

(I plan to get back next week to this series, I'll need to read a bit
more on the spec)

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help