[RFC v2] elf: Extend glibc.rtld.execstack tunable to force executable stack (BZ 32653)
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Wed Feb 12 11:05:30 GMT 2025
On 11/02/25 05:12, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> diff --git a/csu/libc-start.c b/csu/libc-start.c
>> index 6f3d52e223..7a13961b18 100644
>> --- a/csu/libc-start.c
>> +++ b/csu/libc-start.c
>> @@ -307,6 +307,9 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
>>
>> #endif /* !SHARED */
>>
>> + /* Make the thread executable if required. */
>> + GLRO(dl_check_executable_stack) ();
>
> This is really late. Why can't this done from within ld.so?
>
> We don't need this for static binaries.
I think we can, I moved this as late as possible so loader itself would
keep using a non-executable stack. I will send v2.
>
> The tunable is the right approach. I thought we had this already. 8->
We do have an option to avoid an executable-stack altogether.
>
> Thanks,
> Florian
>
More information about the Libc-alpha
mailing list