Thread (20 messages) 20 messages, 5 authors, 2021-09-23

Re: [NEEDS-REVIEW] Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Date: 2021-09-23 23:32:56
Also in: linux-api, linux-doc, linux-mm, lkml

Possibly related (same subject, not in this thread)

On Mon, 2021-09-20 at 09:48 -0700, Andy Lutomirski wrote:
My general opinion here (take this with a grain of salt -- I haven't
paged back in every single detail) is that the kernel should make it
straightforward for a libc to do the right thing without nasty races,
cross-thread coordination, or unnecessary permission to write to the
stack.  I *also* think that it should be possible for userspace to
manage its own shadow stack allocation if it wants to, since I'm sure
there will be JIT or green thread or other use cases that want to do
crazy things that we fail to anticipate with in-kernel magic.

So perhaps we should keep the explicit allocation and free
operations, have a way to opt-in to WRSS being flipped on, but also
do our best to have API that handle the known cases well.

Does that make sense?  Can we have both approaches work in the same
kernel?
I think so. I'll take a look at adding a prctl to enable WRSS. Since
there already is ARCH_X86_CET_DISABLE to disable CET, it doesn't seem
like it should escalate anything. And ARCH_X86_CET_LOCK can prevent
turning it on if desired.

Thanks,

Rick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help