[PATCH v3 1/2] rtld: Enable MTE for stack when specified in .dynamic
Claudiu Zissulescu
claudiu.zissulescu-ianculescu@oracle.com
Tue Mar 17 10:00:24 GMT 2026
On 3/16/26 11:10 AM, Yury Khrustalev wrote:
> On Thu, Mar 12, 2026 at 12:36:36PM +0200, Claudiu Zissulescu wrote:
>>>
>>> This patch should have at least one test checking that the added
>>> functionality works as intended for each supported mode of stack
>>> tagging. Ideally, we should check both statically-linked and
>>> dynamically-linked cases.
>>
>> A test is provided in the second patch. I can add it to this one.
>>
>
> The provided test is for a different use case (setjmp / longjmp). Also,
> the way the test is added requires extra work.
The patch has two tests, one for setjmp/longjmp, and the second one for
the mte stack in general.
The tst-mte-jmp.c is testing setjmp/longjmp.
The tst-mte-stack.c is checking if the stack is correctly set with MTE
flag. The test is placing a mte guarded array on the stack, it uses it,
and finally reads the array beyond the array range. If the stack is not
MTE enabled, the test will continue and exit with an error. If the stack
is MTE enabled, an exception is risen, and the test is successfully.
>> The user application can set it's own MTE behavior, sync or asynchronous. I
>> can understand this may impact other setting. Shall we remove this feature
>> from user control, or shall we have it as tunable? Any other suggestions?
>
> Again, what is your use case here? What are the requirements that you
> want to implement?
Enabling stack protection using MTE, in the same way the stack is
enabled to be executable.
Cheers,
Claudiu
More information about the Libc-alpha
mailing list