[PATCH 2/2] nptl: Enable MTE for stacks created for threads.
Cupertino Miranda
cupertino.miranda@oracle.com
Wed Mar 26 17:26:25 GMT 2025
Hi Florian,
Thanks for the review!
On 14-03-2025 16:35, Florian Weimer wrote:
> * Cupertino Miranda:
>
>> diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
>> index 800ca89720..6155157063 100644
>> --- a/nptl/allocatestack.c
>> +++ b/nptl/allocatestack.c
>> @@ -153,7 +153,8 @@ static int allocate_stack_mode = ALLOCATE_GUARD_MADV_GUARD;
>> static inline int stack_prot (void)
>> {
>> return (PROT_READ | PROT_WRITE
>> - | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0));
>> + | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0)
>> + | stack_mem_tagging_prot ());
>> }
>
> I think we should clean this up and arrange for the dynamic linker to
> determine the PROT_* flags for stacks created at run time, so that we
> can use that variable directly without further processing.
IMHO, we cannot escape from abstracting somehow the final flags as above
with PF_X.
The problem being that each OS would have each own flags and syscalls
and dynamic linker is OS agnostic, AFAIK.
Were you suggesting to create a PF_MTE and abstract it that way ?
Or having dl_stack_flags to immediately be set to PROT_MTE, etc?
Thanks,
Cupertino
>
> Thanks,
> Florian
>
More information about the Libc-alpha
mailing list