about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/csky/libc.abilist
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.ibm.com>2024-07-02 15:25:20 +0200
committerStefan Liebler <stli@linux.ibm.com>2024-07-03 13:01:44 +0200
commitd2f6ceaccbae2f645075dedad2b762896da1ec04 (patch)
treed0e370e96ee8bad1724768d7e05a1a222740266a /sysdeps/unix/sysv/linux/csky/libc.abilist
parent4737e6a7a3f98c8e2674e313cb09d7882583f5f0 (diff)
downloadglibc-master.tar.gz
glibc-master.tar.xz
glibc-master.zip
elf/rtld: Fix auxiliary vector for enable_secure HEAD master
Starting with commit
59974938fe1f4add843f5325f78e2a7ccd8db853
elf/rtld: Count skipped environment variables for enable_secure

The new testcase elf/tst-tunables-enable_secure-env segfaults on s390 (31bit).
There _start parses the auxiliary vector for some additional checks.

Therefore it skips over the zeros after the environment variables ...
0x7fffac20:     0x7fffbd17      0x7fffbd32      0x7fffbd69      0x00000000
------------------------------------------------^^^last environment variable

... and then it parses the auxiliary vector and stops at AT_NULL.
0x7fffac30:     0x00000000      0x00000021      0x00000000      0x00000000
--------------------------------^^^AT_SYSINFO_EHDR--------------^^^AT_NULL
----------------^^^newp-----------------------------------------^^^oldp
Afterwards it tries to access AT_PHDR which points to somewhere and segfaults.

Due to not incorporating the skip_env variable in the computation of oldp
when shuffling down the auxv in rtld.c, it just copies one entry with AT_NULL
and value 0x00000021 and stops the loop.  In reality we have skipped
GLIBC_TUNABLES environment variable (=> skip_env=1). Thus we should copy from
here:
0x7fffac40:     0x00000021      0x7ffff000      0x00000010      0x007fffff
----------------^^^fixed-oldp

This patch fixes the computation of oldp when shuffling down auxiliary vector.
It also adds some checks in the testcase.  Those checks also fail on
s390x (64bit) and x86_64 without the fix.

Co-authored-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/csky/libc.abilist')
0 files changed, 0 insertions, 0 deletions