mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] arm64: gcs: Store GCSCRE0_EL1 values instead of userspace mode
Date: Thu, 15 Oct 2026 14:02:36 +0100	[thread overview]
Message-ID: <bea663db-52fa-487d-9134-606094004f7e@sirena.org.uk> (raw)
In-Reply-To: <atDBVHvDQ3Pwr2Uq@arm.com>

[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2026-10-15 13:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 22:14 [PATCH 0/2] arm64/gcs: Store the GCSCRE0_EL1 register value not " Mark Brown
2026-09-17 22:14 ` [PATCH 1/2] arm64/gcs: Move gcs_check_locked() out of the header Mark Brown
2026-09-17 22:14 ` [PATCH 2/2] arm64: gcs: Store GCSCRE0_EL1 values instead of userspace mode Mark Brown
2026-10-14 17:30   ` Catalin Marinas
2026-10-14 18:28     ` Mark Brown
2026-10-15 12:04       ` Catalin Marinas
2026-10-15 13:02         ` Mark Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bea663db-52fa-487d-9134-606094004f7e@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®