[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <93a3315b3acd8a0585fe266bdfdbd44e54aabaee.camel@intel.com>
Date: Tue, 8 Oct 2024 23:31:16 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "debug@...osinc.com" <debug@...osinc.com>
CC: "kito.cheng@...ive.com" <kito.cheng@...ive.com>, "tglx@...utronix.de"
<tglx@...utronix.de>, "lorenzo.stoakes@...cle.com"
<lorenzo.stoakes@...cle.com>, "linux-arch@...r.kernel.org"
<linux-arch@...r.kernel.org>, "charlie@...osinc.com" <charlie@...osinc.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"samitolvanen@...gle.com" <samitolvanen@...gle.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"peterz@...radead.org" <peterz@...radead.org>, "corbet@....net"
<corbet@....net>, "kees@...nel.org" <kees@...nel.org>,
"alistair.francis@....com" <alistair.francis@....com>, "broonie@...nel.org"
<broonie@...nel.org>, "andybnac@...il.com" <andybnac@...il.com>,
"krzk+dt@...nel.org" <krzk+dt@...nel.org>, "palmer@...belt.com"
<palmer@...belt.com>, "x86@...nel.org" <x86@...nel.org>, "bp@...en8.de"
<bp@...en8.de>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-riscv@...ts.infradead.org"
<linux-riscv@...ts.infradead.org>, "aou@...s.berkeley.edu"
<aou@...s.berkeley.edu>, "arnd@...db.de" <arnd@...db.de>,
"jim.shu@...ive.com" <jim.shu@...ive.com>, "vbabka@...e.cz" <vbabka@...e.cz>,
"shuah@...nel.org" <shuah@...nel.org>, "Liam.Howlett@...cle.com"
<Liam.Howlett@...cle.com>, "oleg@...hat.com" <oleg@...hat.com>,
"alexghiti@...osinc.com" <alexghiti@...osinc.com>, "ebiederm@...ssion.com"
<ebiederm@...ssion.com>, "atishp@...osinc.com" <atishp@...osinc.com>,
"richard.henderson@...aro.org" <richard.henderson@...aro.org>,
"cleger@...osinc.com" <cleger@...osinc.com>, "brauner@...nel.org"
<brauner@...nel.org>, "hpa@...or.com" <hpa@...or.com>, "mingo@...hat.com"
<mingo@...hat.com>, "robh@...nel.org" <robh@...nel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"paul.walmsley@...ive.com" <paul.walmsley@...ive.com>, "linux-mm@...ck.org"
<linux-mm@...ck.org>, "evan@...osinc.com" <evan@...osinc.com>,
"conor@...nel.org" <conor@...nel.org>, "akpm@...ux-foundation.org"
<akpm@...ux-foundation.org>, "linux-doc@...r.kernel.org"
<linux-doc@...r.kernel.org>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>
Subject: Re: [PATCH v6 16/33] riscv/shstk: If needed allocate a new shadow
stack on clone
On Tue, 2024-10-08 at 16:17 -0700, Deepak Gupta wrote:
> Yeah you're right. Honestly, I've been shameless in adapting most of the flows
> from x86 `shstk.c` for risc-v. So thank you for that.
All good, glad we ended up with similar behavior.
>
> Now that we've `ARCH_HAS_USER_SHADOW_STACK` part of multiple patch series (riscv
> shadowstack, clone3 and I think arm64 gcs series as well). It's probably the
> appropriate time to find common grounds.
There have been bugs in the similar bits of code. So will be nice to not have to
fix them in each arch too.
>
> This is what I suggest
>
> - move most of the common/arch agnostic shadow stack stuff in kernel/shstk.c
> This gets part of compile if `ARCH_HAS_USER_SHADOW_STACK` is enabled/selected.
Yea, I guess we have commonality for (in x86 naming):
- map_shadow_stack()
- shstk_free()
- shstk_alloc_thread_stack()
- shstk_setup()
The signal part starts to diverge. Then I guess x86 has a different prctl
interface.
>
> - allow arch specific branch out guard checks for "if cpu supports", "is shadow stack
> enabled on the task_struct" (I expect each arch layout of task_struct will be
> different, no point finding common ground there), etc.
Sure.
>
> I think it's worth a try.
> If you already don't have patches, I'll spend some time to see what it takes to
> converge in my next version. If I end up into some roadblock, will use this thread
> for further discussion.
Sounds good. I have not looked at it too much.
Powered by blists - more mailing lists