[PATCH v2 3/3] aarch64: GCS: add clone3 tests for shadow stack
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Mon Sep 15 13:31:10 GMT 2025
On 15/09/25 08:37, Yury Khrustalev wrote:
> On Tue, Sep 09, 2025 at 11:31:53AM -0300, Adhemerval Zanella Netto wrote:
>>
>>> Parsing /proc/self/smaps requires much more code, I'll add it in the
>>> next version of the patch. After the thread started we'll have 2
>>> mappings with with the ss flag: parent and child. After cancellation we
>>> expect 1 mapping (the parent one).
>>
>> It depends if the kernel supports MADV_GUARD_INSTALL and if the pthread
>> requires a guard page. I think to simplify you can disable the guard page
>> to always expect one mapping.
>
> Unless I'm missing something, I don't think guard page is involved here
> at all. We have parent and child shadow stacks after the thread started
> and only parent's shadow stack remains when the thread is cancelled.
I meant to count the number of VMA as presented in /proc/self/smaps, assuming
the idea is to take a snapshot before and after pthread_create/pthread_join
to check the difference.
If the underlying kernel supports MADV_GUARD_INSTALL we will not have the guard
page.
More information about the Libc-alpha
mailing list