[PATCH 3/3] Misc: Add <sys/cstack.h> and the cstack_* family of functions

Florian Weimer fweimer@redhat.com
Tue May 25 12:23:02 GMT 2021


* Adhemerval Zanella:

> On 25/05/2021 04:40, Florian Weimer wrote:
>> * Paul Eggert:
>> 
>>> On 5/24/21 12:11 PM, Adhemerval Zanella via Libc-alpha wrote:
>>>
>>>> If this is really a requirement, I think the best options would be to add
>>>> an extra flag to opt-in.
>>>
>>> Opt-in works for me. Although the GNU apps I help maintain typically
>>> don't have nested functions, nested functions are a longstanding GNU C 
>>> feature and are a good thing to have when you need them.
>> 
>> Since the requirement for non-executable stacks does not encapsulate
>> well, I'd rather make this automatic if you think executable stack
>> support is required.  (The code allocating the stack might not know
>> about the trampolines.)
>
> Although honoring PT_GNU_STACK seems the most straightforward I still
> think we should make it a opt-in, executable stacks has strong security
> implications and I think it is better the caller knows it is enabling.

The caller may not know whether signal handlers need executable stacks,
though.  That's what I meant with the lack of encapsulation.

Thanks,
Florian



More information about the Libc-alpha mailing list