[PATCH 2/2] arm64: gcs: Store GCSCRE0_EL1 values instead of userspace mode
Mark Brown
broonie at kernel.org
Thu Oct 15 06:02:36 PDT 2026
On Thu, Oct 15, 2026 at 01:04:36PM +0100, Catalin Marinas wrote:
> On Wed, Oct 14, 2026 at 07:28:08PM +0100, Mark Brown wrote:
> > We also set the mode from ptrace at which point it's being set for a
> > different thread.
> Could we do like in arch_set_shadow_stack_status() for gcspr_el0 and
> only set it if task == current?
Yeah, that does work too.
> > The case where a signal handler tries to handle a GCS fault by disabling
> > GCS could be handled using prctl() if someone wants it. I'm not aware
> > of anyone doing that yet, there was some talk about implementing it in
> > glibc at LPC but it's not been implemented.
> Just thinking, if we fault on a modified field, a handler using prctl()
> would also have to update features_enabled in the sigcontext, otherwise
> sigreturn fails. I think that is already the case today for disabling
> (the frame still has ENABLE, so sigreturn returns -EINVAL). prctl()
> changes to WRITE/PUSH are silently reverted.
Yes.
> Another option is to ignore the field on sigreturn and keep it for
> information only. I favour the latter, but it needs to be a separate
> patch for discussion and a change to the sigreturn text in
> Documentation/arch/arm64/gcs.rst.
OK, I can do that. I'd already prepared something with this as a
separate commit before the other two, I'll revise it to ignore.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20261015/4e16740b/attachment.sig>
More information about the linux-arm-kernel
mailing list