[RFC] <sys/tagged-address.h>: An API for tagged address

Szabolcs Nagy szabolcs.nagy@arm.com
Mon Feb 22 08:27:24 GMT 2021


The 02/18/2021 14:32, H.J. Lu wrote:
> 
> We are working to enable LAM in glibc and GCC (HWASAN).
> 
> 0. LAM is disabled when the process starts.
> 1. Define GNU property markers for LAM compatibility.
> 2. Update ld.so to support LAM.
> 3. Make libc.so LAM compatible (memmove).

if pointers to the same object always have the same tag,
then memmove should work without changes i think.

if such pointers can have different tags then all pointer
comparisions are problematic, not just memmove.

> 4. Provide an API to enable LAM.
> 
> We noticed a few issues:
> 
> 1. HWASAN should use the glibc API to enable tagged address
> since glibc must track the tagged address mask.

how does that mask work?
is it possible to set it to different values or just on/off?

> 2. set_tagged_address_mask shouldn't be allowed after
> pthread_create is called.

such api breaks software composability.
i don't have a good solution (other than libc doing an early
decision on its own).

> 3. After set_tagged_address_mask is called, can it be called
> again to change tagged address mask.

after tagged pointers escape it is unlikely that changing
settings works.



More information about the Libc-alpha mailing list