[PATCH v2 2/3] nptl: Add libc allocated shadow stack for new threads
enh
enh@google.com
Fri Oct 3 19:55:13 GMT 2025
On Thu, Oct 2, 2025 at 11:49 AM Mark Brown <broonie@kernel.org> wrote:
>
> On Wed, Oct 01, 2025 at 05:19:20PM -0400, enh wrote:
> > On Wed, Oct 1, 2025 at 3:38 PM Edgecombe, Rick P
>
> > > Since sigaltstack() doesn't have an alloc/free pattern in the API there isn't a
> > > way to do it automatically for existing apps. It sounds like that is not a
> > > problem for this usage?
>
> > bionic basically mmap()s two stacks for every thread, and calls
> > sigaltstack() for you. (so as long as there's some way for us to
> > explain to the kernel what's going on, that's fine --- we can just
> > change pthread_create() [and main thread initialization] to do that.)
>
> So you're just always handling signals on an alternative stack,
yeah, pretty much.
> or is
> there anything fancier in the usage?
not that i know of.
(weasel words only because with a large enough ecosystem, someone will
be doing anything you can possibly imagine...)
> At the minute when shadow stacks
> are enabled those signals will use the standard shadow stack together
> with the alternative normal stack.
which is probably fine?
More information about the Libc-alpha
mailing list