Question about stack protector in RELRO on Linux
Jakob Koschel
jkl820.git@gmail.com
Mon Mar 16 10:24:23 GMT 2026
I came across Florian Weimer's talk on "New TLS allocators for glibc" and reached out with some questions with the suggestion to move it here (this is my first time posting here, so I hope this fits).
I've been looking at this mostly in the context of https://sourceware.org/bugzilla/show_bug.cgi?id=22850 and what could be done to avoid a large contiguous stack overflow to overwrite the stack protector value in the TCB.
Florian mentioned in his response that GCC 16 would likely allow mirroring the OpenBSD model of putting the stack protector into RELRO memory. I was curious what changes in gcc/glibc does that actually require? Is the compiler side of things primarily using `-mstack-protector-guard=global` and most changes for it need to happen in glibc (to support 'global' on x86_64 Linux and allocate it correctly in RELRO)?
As for splitting static TLS and stack on non-main threads, I understood it's not worth it doing it in two transitions (splitting it and then moving to the new TLS allocator) and the new TLS allocator is mostly "struggling" with supporting sanitizers correctly.
Probably a stupid question: Would it be possible to add a guard page between stack and static TLS?
I'm guessing it's not worth it given the "problem" will go eventually away with the new TLS allocator and allowing to store the stack protector in RELRO.
Apologies if this is the wrong venue.
Thank you,
Jakob
More information about the Libc-alpha
mailing list