[PATCH v4 19/22] aarch64: Process gnu properties in static exe

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Fri Dec 6 14:05:59 GMT 2024



On 06/12/24 08:55, Yury Khrustalev wrote:
> On Tue, Dec 03, 2024 at 03:56:45PM -0300, Adhemerval Zanella Netto wrote:
>>
>>
>> On 29/11/24 13:37, Yury Khrustalev wrote:
>>> From: Szabolcs Nagy <szabolcs.nagy@arm.com>
>>>
>>> Unlike for BTI, the kernel does not process GCS properties so update
>>> GL(dl_aarch64_gcs) before the GCS status is set.
>>
>> Although it would only used for aarch64, I think we should make this change
>> generic as I suggested for memory sealing support [1].
>>
>> [1] https://patchwork.sourceware.org/project/glibc/patch/20240930200831.1669010-3-adhemerval.zanella@linaro.org/
> 
> I can see some similatiry however in the case of GCS it's crucial to initialise
> it as early as possible. In the patch [1] you referenced this setup would occur
> after a number of function calls (as far as I can tell from the sources).
> 
> I agree that it makes sense to make this change generic eventually, but at this
> point I don't see how to do it. I'd like to leave it AArch64 specific for now.

The main problem is to enable memory sealing would incur in double in processing
PT_GNU_PROPERTY multiple time, which its wasteful.  

Maybe we can add another call to process the PT_NOTE / PT_GNU_PROPERTY prior 
ARCH_SETUP_TLS (since notes/property processing should not rely on TCB 
support). 


More information about the Libc-alpha mailing list