The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "tglx@kernel.org" <tglx@kernel.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"bp@alien8.de" <bp@alien8.de>, "pjw@kernel.org" <pjw@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"aou@eecs.berkeley.edu" <aou@eecs.berkeley.edu>,
	"shuah@kernel.org" <shuah@kernel.org>,
	"palmer@dabbelt.com" <palmer@dabbelt.com>,
	"bill.roberts@arm.com" <bill.roberts@arm.com>,
	"alex@ghiti.fr" <alex@ghiti.fr>,
	"x86@kernel.org" <x86@kernel.org>
Cc: "linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH 1/2] x86/shstk: support via prctl
Date: Tue, 4 Aug 2026 18:49:34 +0000	[thread overview]
Message-ID: <5ed7d0f5baa920bb8feefd64444939c33397bbb0.camel@intel.com> (raw)
In-Reply-To: <030bdb74-7938-49ab-809c-5fefae4316b1@arm.com>

On Tue, 2026-08-04 at 13:23 -0500, Bill Roberts wrote:
> When they add unlock to the generic interface, then that will be the 
> time to rectify that. Just looking
> through patches and stuff, I think that side is still in flight, eg 
> https://lkml.org/lkml/2026/4/3/1651.

This looks like it is about clearing lock bits after exec. What I am talking
about is "PTRACE_ARCH_PRCTL". It's a special ptrace capability that only can
poke at arch_prtcl and not regular prctl.

> It also looks like the model is slightly different, in that there is a 
> window when all of this should be
> handled, and then locked permanently. I know on our side of the house, 
> locking isn't really being
> used yet. But that's criu, right now, the main things I would like to 
> coalesce is libc's.
> 

IIRC CRIU needed to unlock shadow stack during the save. Because it's tricks for
saving the process involved messing with the stack. So it needs to be able to
unlock but *only* via ptrace. Apps cannot be allowed to unlock themselves.
Because, well, obviously..


>  As MUSL and
> others get patches, it would be much simpler to have one interface to do 
> this in, and right now
> unlock is unused (even in the test suite :-p).

I think I raised this on the other arch's APIs originally. x86 went first, and
then later arm/riscv wanted a unified approach, but didn't solve this ptrace
unlock part. So we didn't join. AFAICT the situation hasn't changed. So I'm
worried it's too soon to unify. Or we might need to do multiple steps of
unifications.

Also looking forward to understanding the security module problem statement
better.

> 
> Ill spin out a v2 with the comments, but the one thing left to be 
> addressed, afaik, is the testing patch
> do you want that? I'll drop it, but I think that's a bad approach.

Yea, I hear your point. It is good to test more, but #including c files with
pre-processor switches seems too hacky. Is there anything we could do to make it
in one c file? Like not the templated tricks to generate two test binaries? For
example embed the switch between the two APIs in a macros in the single file.
Like say we have SHSTK_ENABLE(). Inside it does either ARCH_PRCTL() or regular.
Then have a global or something that switches between the two behaviors. Pull
out the parts in main() into something that could be run twice?

  reply	other threads:[~2026-08-04 18:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 15:47 [PATCH 0/2] x86: Support shstk via prctl Bill Roberts
2026-07-14 15:47 ` [PATCH 1/2] x86/shstk: support " Bill Roberts
2026-07-29 13:29   ` Edgecombe, Rick P
2026-08-03 17:41     ` Bill Roberts
2026-08-03 18:14       ` Edgecombe, Rick P
2026-08-04 18:23         ` Bill Roberts
2026-08-04 18:49           ` Edgecombe, Rick P [this message]
2026-08-04 20:43             ` Bill Roberts
2026-08-04 21:59               ` Edgecombe, Rick P
2026-08-05 17:16                 ` Bill Roberts
2026-07-14 15:47 ` [PATCH 2/2] selftests/x86: add generic prctl shadow stack test Bill Roberts
2026-07-29 13:31   ` Edgecombe, Rick P
2026-08-03 17:50     ` Bill Roberts

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=5ed7d0f5baa920bb8feefd64444939c33397bbb0.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=bill.roberts@arm.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mingo@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=shuah@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@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