From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "broonie@kernel.org" <broonie@kernel.org>
Cc: "dietmar.eggemann@arm.com" <dietmar.eggemann@arm.com>,
"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
"shuah@kernel.org" <shuah@kernel.org>,
"brauner@kernel.org" <brauner@kernel.org>,
"jannh@google.com" <jannh@google.com>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"debug@rivosinc.com" <debug@rivosinc.com>,
"mgorman@suse.de" <mgorman@suse.de>,
"Szabolcs.Nagy@arm.com" <Szabolcs.Nagy@arm.com>,
"fweimer@redhat.com" <fweimer@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"hjl.tools@gmail.com" <hjl.tools@gmail.com>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"vschneid@redhat.com" <vschneid@redhat.com>,
"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
"kees@kernel.org" <kees@kernel.org>,
"will@kernel.org" <will@kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"yury.khrustalev@arm.com" <yury.khrustalev@arm.com>,
"bp@alien8.de" <bp@alien8.de>,
"wilco.dijkstra@arm.com" <wilco.dijkstra@arm.com>,
"bsegall@google.com" <bsegall@google.com>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"juri.lelli@redhat.com" <juri.lelli@redhat.com>
Subject: Re: [PATCH RFT v9 4/8] fork: Add shadow stack support to clone3()
Date: Tue, 20 Aug 2024 23:57:23 +0000 [thread overview]
Message-ID: <82be9ec6e43a018add8d9bbc6ba67feee676f32e.camel@intel.com> (raw)
In-Reply-To: <cc2e7d86-c890-4cb1-8cad-1cfaa9f53dc8@sirena.org.uk>
On Wed, 2024-08-21 at 00:34 +0100, Mark Brown wrote:
> > Why do we need both shadow_stack and shadow_stack_size? We are basically
> > asking
> > it to consume a token at a pointer and have userspace manage the shadow
> > stack
> > itself. So why does the kernel care what size it is? Couldn't we just have
> > 'shadow_stack' have that mean consume a token here.
>
> I was doing things this way for symmetry with how we specify the normal
> stack. That's a bit different since the kernel will actually use the
> size for the normal stack but it felt nicer to keep things looking
> consistent, it saves users wondering why they work differently. It's
> also a bit of a help with portability given that arm64 expects to have a
> top of stack marker above the token by default while x86 doesn't support
> that.
Hmm, so then on arm the kernel would look for the token down a frame. Hmm. I
think it makes it even stranger ABI wise.
SHADOW_STACK_SET_MARKER can be optional (not on arm, but could be in the
future). Then the shadow_stack_size to token offset behavior would depend on
some historical originally supported combination of map_shadow_stack args.
BTW, just to try to reduce potential future revisions, what do you think about
the 8 byte alignment need? Did I miss the check somewhere?
next prev parent reply other threads:[~2024-08-20 23:57 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 19:24 [PATCH RFT v9 0/8] fork: Support shadow stacks in clone3() Mark Brown
2024-08-19 19:24 ` [PATCH RFT v9 1/8] Documentation: userspace-api: Add shadow stack API documentation Mark Brown
2024-08-19 19:24 ` [PATCH RFT v9 2/8] selftests: Provide helper header for shadow stack testing Mark Brown
2024-08-20 21:36 ` Edgecombe, Rick P
2024-08-19 19:24 ` [PATCH RFT v9 3/8] mm: Introduce ARCH_HAS_USER_SHADOW_STACK Mark Brown
2024-08-19 19:24 ` [PATCH RFT v9 4/8] fork: Add shadow stack support to clone3() Mark Brown
2024-08-20 21:36 ` Edgecombe, Rick P
2024-08-20 23:34 ` Mark Brown
2024-08-20 23:57 ` Edgecombe, Rick P [this message]
2024-08-21 0:19 ` Mark Brown
2024-08-21 1:45 ` Edgecombe, Rick P
2024-08-21 12:45 ` Mark Brown
2024-08-21 15:54 ` Edgecombe, Rick P
2024-08-21 17:23 ` Mark Brown
2024-08-21 18:05 ` Catalin Marinas
2024-09-27 8:50 ` Christian Brauner
2024-09-27 15:21 ` Edgecombe, Rick P
2024-10-01 15:12 ` Christian Brauner
2024-10-01 17:33 ` Mark Brown
2024-10-01 23:03 ` Edgecombe, Rick P
2024-10-02 13:42 ` Mark Brown
2024-10-02 21:01 ` Mark Brown
2024-10-02 21:25 ` Edgecombe, Rick P
2024-10-03 16:05 ` Yury Khrustalev
2024-08-19 19:24 ` [PATCH RFT v9 5/8] selftests/clone3: Remove redundant flushes of output streams Mark Brown
2024-08-19 19:24 ` [PATCH RFT v9 6/8] selftests/clone3: Factor more of main loop into test_clone3() Mark Brown
2024-08-19 19:24 ` [PATCH RFT v9 7/8] selftests/clone3: Allow tests to flag if -E2BIG is a valid error code Mark Brown
2024-08-19 19:24 ` [PATCH RFT v9 8/8] selftests/clone3: Test shadow stack support Mark Brown
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=82be9ec6e43a018add8d9bbc6ba67feee676f32e.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=Szabolcs.Nagy@arm.com \
--cc=bp@alien8.de \
--cc=brauner@kernel.org \
--cc=broonie@kernel.org \
--cc=bsegall@google.com \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=debug@rivosinc.com \
--cc=dietmar.eggemann@arm.com \
--cc=fweimer@redhat.com \
--cc=hjl.tools@gmail.com \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=juri.lelli@redhat.com \
--cc=kees@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=wilco.dijkstra@arm.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=yury.khrustalev@arm.com \
/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