[PATCH v6 19/20] elf: Fix runtime linker auditing on aarch64 (BZ #26643)

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Dec 21 17:49:51 GMT 2021



On 21/12/2021 14:47, Szabolcs Nagy wrote:
> The 11/15/2021 15:37, Adhemerval Zanella via Libc-alpha wrote:
>> --- a/sysdeps/aarch64/bits/link.h
>> +++ b/sysdeps/aarch64/bits/link.h
>> @@ -20,23 +20,29 @@
>>  # error "Never include <bits/link.h> directly; use <link.h> instead."
>>  #endif
>>  
>> +typedef union
>> +{
>> +  float s;
>> +  double d;
>> +  long double q;
>> +} La_aarch64_vector;
>> +
>>  /* Registers for entry into PLT on AArch64.  */
>>  typedef struct La_aarch64_regs
>>  {
>> -  uint64_t lr_xreg[8];
>> -  uint64_t lr_dreg[8];
>> -  uint64_t lr_sp;
>> -  uint64_t lr_lr;
>> +  uint64_t          lr_xreg[9];
>> +  La_aarch64_vector lr_vreg[8];
>> +  uint64_t          lr_sp;
>> +  uint64_t          lr_lr;
>>  } La_aarch64_regs;
>>  
>>  /* Return values for calls from PLT on AArch64.  */
>>  typedef struct La_aarch64_retval
>>  {
>> -  /* Up to two integer registers can be used for a return value.  */
>> -  uint64_t lrv_xreg[2];
>> -  /* Up to four D registers can be used for a return value.  */
>> -  uint64_t lrv_dreg[4];
>> -
>> +  /* Up to eight integer registers can be used for a return value.  */
>> +  uint64_t          lrv_xreg[8];
>> +  /* Up to eight V registers can be used for a return value.  */
>> +  La_aarch64_vector lrv_vreg[8];
>>  } La_aarch64_retval;
>>  __BEGIN_DECLS
> 
> 
> i think for variant_pcs we will only need a
> 
> void *extension;
> 
> or similar member at the end of both structs.
> 
> (we can make it point to a dump of all registers
> in some format for variant_pcs PLT hooks)
> 
> if this can avoid a second bump of LAV_CURRENT
> when we add variant_pcs support then it may be
> useful to have. (if this turns out to be not
> enough then we don't lose much, but it also
> means users have to check extension==0 for now
> and avoid interpreting or touching the registers
> otherwise. not sure if this is better or bump,
> depends on how many users need to keep updating
> their auditor libs on our bumps.)

That's my idea as well, I really don't want to bump LAV_CURRENT for
aarch64 on 2.36.


More information about the Libc-alpha mailing list