diff options
author | Ben Woodard <woodard@redhat.com> | 2021-07-30 16:59:39 +0000 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-09-10 15:07:38 -0300 |
commit | 171fdd4bd4f337001db053721477add60d205ed8 (patch) | |
tree | 9b020ab20f8f032f5f49e9fbd44e9f2933dfbcbc /sysdeps/aarch64/Makefile | |
parent | 9e451b8735acdb8d1b850f13c7ab2b59af36d9e9 (diff) | |
download | glibc-171fdd4bd4f337001db053721477add60d205ed8.tar.gz |
elf: Fix runtime linker auditing on aarch64 (BZ #26643)
The dynamic linker's auditing was not working on aarch64. There were
two distinct problems:
1. _dl_runtime_resolve was not preserving x8 the indirect result
location register.
2. The NEON Q registers pushed onto the stack by _dl_runtime_resolve()
were twice the size of D registers extracted from the stack frame by
_dl_runtime_profile().
To fix it the rtld-auditor interfaces is changed for aarch64:
* LAV_CURRENT is bumped to v2 and loader will fail to load audit
modules that return a version different than the one supported.
* The La_aarch64_regs structure was expanded to include x8 and the
full sized NEON V registers that are required to be preserved by the
ABI.
* dl_runtime_profile needed to extract registers saved by
_dl_runtime_resolve and put them into the new correctly sized
La_aarch64_regs structure.
* The return value structure La_aarch64_retval also did not have the
correctly sized NEON V registers.
Similar to x86, a new La_aarch64_vector type to represent the NEON
register is added on the La_aarch64_regs (so each type can be accessed
easier).
Checked on aarch64-linux-gnu.
Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/aarch64/Makefile')
-rw-r--r-- | sysdeps/aarch64/Makefile | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index 7c66fb97aa..7183895d04 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -10,6 +10,26 @@ endif ifeq ($(subdir),elf) sysdep-dl-routines += dl-bti + +tests += tst-audit26 \ + tst-audit27 + +modules-names += \ + tst-audit26mod \ + tst-auditmod26 \ + tst-audit27mod \ + tst-auditmod27 + +$(objpfx)tst-audit26: $(objpfx)tst-audit26mod.so \ + $(objpfx)tst-auditmod26.so +LDFLAGS-tst-audit26 += -Wl,-z,lazy +tst-audit26-ENV = LD_AUDIT=$(objpfx)tst-auditmod26.so + +$(objpfx)tst-audit27: $(objpfx)tst-audit27mod.so \ + $(objpfx)tst-auditmod27.so +$(objpfx)tst-audit27mod.so: $(libsupport) +LDFLAGS-tst-audit27 += -Wl,-z,lazy +tst-audit27-ENV = LD_AUDIT=$(objpfx)tst-auditmod27.so endif ifeq ($(subdir),elf) |