[PATCH v2 2/3] nptl: Add libc allocated shadow stack for new threads

Mark Brown broonie@kernel.org
Thu Oct 2 15:49:35 GMT 2025


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, or is
there anything fancier in the usage?  At the minute when shadow stacks
are enabled those signals will use the standard shadow stack together
with the alternative normal stack.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20251002/50740c0f/attachment.sig>


More information about the Libc-alpha mailing list