glibc/sysdeps/generic
Ben Woodard b118bce87a elf: Fix runtime linker auditing on aarch64 (BZ #26643)
The rtld audit support show two problems on aarch64:

  1. _dl_runtime_resolve does not preserve x8, the indirect result
      location register, which might generate wrong result calls
      depending of the function signature.

  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.

While 2. might result in wrong information passed on the PLT tracing,
1. generates wrong runtime behaviour.

The aarch64 rtld audit support is changed to:

  * Both La_aarch64_regs and La_aarch64_retval are expanded to include
    both x8 and the full sized NEON V registers, as defined 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 LAV_CURRENT check is change to only accept new audit modules
    to avoid the undefined behavior of not save/restore x8.

  * Different than other architectures, audit modules older than
    LAV_CURRENT are rejected (both La_aarch64_regs and La_aarch64_retval
    changed their layout and there are no requirements to support multiple
    audit interface with the inherent aarch64 issues).

  * A new field is also reserved on both La_aarch64_regs and
    La_aarch64_retval to support variant pcs symbols.

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
directly).

Since LAV_CURRENT was already bumped to support bind-now, there is
no need to increase it again.

Checked on aarch64-linux-gnu.

Co-authored-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit ce9a68c57c)

Resolved conflicts:
	NEWS
	elf/rtld.c
2022-04-12 13:33:10 -04:00
..
net
netinet
nfs
sys
_G_config.h
_itoa.h
a.out.h
abort-instr.h
adaptive_spin_count.h
aio_misc.h
allocalim.h
arch-fd_to_filename.h
asm-syntax.h
atomic-machine.h
c++-types.data
confstr.h
crti.S
crtn.S
device-nrs.h
dirstream.h
dl-audit-check.h elf: Fix runtime linker auditing on aarch64 (BZ #26643) 2022-04-12 13:33:10 -04:00
dl-auxv.h
dl-cache.h
dl-dtprocnum.h
dl-dtv.h
dl-fcntl.h
dl-fileid.h
dl-fixup-attribute.h elf: Add _dl_audit_pltexit 2022-04-08 14:18:12 -04:00
dl-fptr.h
dl-hash.h
dl-hwcap-check.h
dl-irel.h
dl-isa-level.h
dl-librecon.h
dl-lookupcfg.h elf: Issue la_symbind for bind-now (BZ #23734) 2022-04-12 13:32:59 -04:00
dl-machine-rel.h elf: Add _dl_audit_pltexit 2022-04-08 14:18:12 -04:00
dl-machine.h elf: Fix dynamic-link.h usage on rtld.c 2022-04-08 14:18:11 -04:00
dl-mman.h
dl-osinfo.h
dl-procinfo.c
dl-procinfo.h
dl-procruntime.c
dl-prop.h
dl-relocate-ld.h ld.so: Initialize bootstrap_map.l_ld_readonly [BZ #28340] 2021-11-03 07:53:12 +01:00
dl-sysdep.h
dl-tls.h
dl-unistd.h
dl-vdso-setup.c
dl-vdso-setup.h
dl-vdso.h
dwarf2.h
elf_machine_sym_no_match.h
elf-initfini.h
elf-read-prop.h
elide.h
eloop-threshold.h
entry.h
errqueue.h
fd_to_filename.h
features-time64.h
fenv_private.h
fips-private.h
fix-fp-int-compare-invalid.h
fix-fp-int-convert-overflow.h
fix-int-fp-convert-zero.h
float128-abi.h
fork.h
fpu_control.h
framestate.c
gcc-compat.h
gccframe.h
get-rounding-mode.h
gmp-mparam.h
hp-timing-common.h
hp-timing.h
ifreq.h
ifunc-init.h
ifunc-sel.h
internal-signals.h
intr-msg.h
ld.abilist
ldbl-classify-compat.h
ldconfig.h
ldsodefs.h elf: Issue la_symbind for bind-now (BZ #23734) 2022-04-12 13:32:59 -04:00
libanl.abilist
libBrokenLocale.abilist
libc_malloc_debug.abilist Move malloc hooks into a compat DSO 2021-07-22 18:37:59 +05:30
libc_start_call_main.h
libc-lock.h
libc-mmap.h
libc-mtag.h
libc-start.h
libc-symver.h
libc-tsd.h
libc.abilist
libcrypt.abilist
libdl.abilist
libm-alias-double.h
libm-alias-float128.h
libm-alias-float.h
libm-alias-ldouble.h
libm-test-ulps
libm-test-ulps-name
libm.abilist
libnsl.abilist
libnss_compat.abilist
libnss_db.abilist
libnss_dns.abilist
libnss_files.abilist
libnss_hesiod.abilist
libnss_nis.abilist
libnss_nisplus.abilist
libpthread.abilist
libresolv.abilist
librt.abilist
libutil.abilist
link_map.h
linkmap.h
local-setxid.h
localplt.data mtrace: Wean away from malloc hooks 2021-07-22 18:38:06 +05:30
machine-gmon.h
machine-lock.h
machine-sp.h
Makefile
malloc-alignment.h
malloc-machine.h
malloc-size.h
malloc-sysdep.h
math_ldbl_opt.h
math_ldbl.h
math_private_calls.h
math_private.h
math-barriers.h
math-nan-payload-double.h
math-nan-payload-float.h
math-narrow-alias-float128.h
math-tests-arch.h
math-tests-exceptions.h
math-tests-rounding.h
math-tests-snan-cast.h
math-tests-snan-payload.h
math-tests-snan.h
math-tests-trap-force.h
math-tests-trap.h
math-tests.h
math-type-macros-double.h
math-type-macros-float128.h
math-type-macros-float.h
math-type-macros-ldouble.h
math-type-macros.h
math-use-builtins-ceil.h
math-use-builtins-copysign.h
math-use-builtins-floor.h
math-use-builtins-fma.h
math-use-builtins-nearbyint.h
math-use-builtins-rint.h
math-use-builtins-round.h
math-use-builtins-roundeven.h
math-use-builtins-sqrt.h
math-use-builtins-trunc.h
math-use-builtins.h
memcopy.h
memusage.h
mmap_info.h
nan-high-order-bit.h
not-cancel.h
not-errno.h
nscd-types.h
pagecopy.h
paths.h
profil-counter.h
pty-private.h
register-dump.h
rtld_static_init.h
rtld-lowlevel.h
safe-fatal.h
setjmpP.h
sigcontextinfo.h
siglist-compat.c
siglist-compat.h
siglist.h
sigset-cvt-mask.h
sigsetops.h
single-thread.h
spawn_int_def.h
stackguard-macros.h
stackinfo.h
stap-probe-machine.h
startup.h
stdio-lock.h
string_private.h
struct_stat_time64.h
symbol-hacks.h
sysdep-cancel.h
sysdep.h
thread_state.h
time64-compat.h
time-clockid.h
tininess.h
tls-internal-struct.h
tls-internal.c
tls-internal.h
tls-macros.h
tls-setup.h
tls.h
tst-audit.h
tst-stack-align.h
unsecvars.h
unwind-arch.h
unwind-dw2-fde-glibc.c
unwind-dw2-fde.c
unwind-dw2-fde.h
unwind-dw2.c
unwind-link.h
unwind-pe.c
unwind-pe.h
unwind-resume.c
unwind-resume.h
unwind.h
utmp-equal.h
xstatver.h