glibc/sysdeps/generic
Adhemerval Zanella 1bdda52fe9 elf: Move vDSO setup to rtld (BZ#24967)
This patch moves the vDSO setup from libc to loader code, just after
the vDSO link_map setup.  For static case the initialization
is moved to _dl_non_dynamic_init instead.

Instead of using the mangled pointer, the vDSO data is set as
attribute_relro (on _rtld_global_ro for shared or _dl_vdso_* for
static).  It is read-only even with partial relro.

It fixes BZ#24967 now that the vDSO pointer is setup earlier than
malloc interposition is called.

Also, vDSO calls should not be a problem for static dlopen as
indicated by BZ#20802.  The vDSO pointer would be zero-initialized
and the syscall will be issued instead.

Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu,
arm-linux-gnueabihf, powerpc64le-linux-gnu, powerpc64-linux-gnu,
powerpc-linux-gnu, s390x-linux-gnu, sparc64-linux-gnu, and
sparcv9-linux-gnu.  I also run some tests on mips.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2020-01-03 11:22:07 -03:00
..
net Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
netinet Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
nfs Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sys Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
_G_config.h Post-cleanup 2: minimize _G_config.h. 2018-02-07 10:10:32 -05:00
_itoa.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
a.out.h
abort-instr.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
adaptive_spin_count.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
aio_misc.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
allocalim.h
asm-syntax.h
atomic-machine.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
c++-types.data
confstr.h
device-nrs.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dirstream.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-cache.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-dtprocnum.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-dtv.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-fcntl.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-fileid.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-fptr.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-hash.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-irel.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-librecon.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-machine.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-mman.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-osinfo.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-procinfo.c
dl-procinfo.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-procruntime.c ld.so: Add architecture specific fields 2017-11-13 08:02:52 -08:00
dl-prop.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-sysdep.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-tls.h
dl-unistd.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dl-vdso-setup.c elf: Move vDSO setup to rtld (BZ#24967) 2020-01-03 11:22:07 -03:00
dl-vdso-setup.h elf: Move vDSO setup to rtld (BZ#24967) 2020-01-03 11:22:07 -03:00
dl-vdso.h elf: Move vDSO setup to rtld (BZ#24967) 2020-01-03 11:22:07 -03:00
dwarf2.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
elide.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
eloop-threshold.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
entry.h
errqueue.h
exit-thread.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
fd_to_filename.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
fenv_private.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
fips-private.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
fix-fp-int-compare-invalid.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
fix-fp-int-convert-overflow.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
fix-int-fp-convert-zero.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
float128-abi.h Move some float128 symbol version definitions. 2017-10-16 22:04:42 +00:00
fork.h
fpu_control.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
framestate.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
gcc-compat.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
gccframe.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
get-rounding-mode.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
gmp-mparam.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
hp-timing-common.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
hp-timing.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ifreq.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ifunc-init.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ifunc-sel.h
internal-signals.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
intr-msg.h
ld.abilist
ldbl-classify-compat.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ldconfig.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ldsodefs.h elf: Move vDSO setup to rtld (BZ#24967) 2020-01-03 11:22:07 -03:00
libanl.abilist
libBrokenLocale.abilist
libc-lock.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc-mmap.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc-start.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc-tsd.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc.abilist
libcrypt.abilist
libdl.abilist
libm-alias-double.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libm-alias-float128.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libm-alias-float.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libm-alias-ldouble.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libm-test-ulps Replace gen-libm-test.pl with gen-libm-test.py. 2018-08-09 15:34:12 +00:00
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 ld.so: Add architecture specific fields 2017-11-13 08:02:52 -08:00
linkmap.h
local-setxid.h
localplt.data ld.so: Introduce struct dl_exception 2017-08-10 16:54:57 +02:00
machine-gmon.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
machine-lock.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
machine-sp.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
malloc-alignment.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
malloc-machine.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
malloc-sysdep.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math_ldbl_opt.h Use PRINTF_LDBL_IS_DBL instead of __ldbl_is_dbl. 2018-12-05 18:15:43 -02:00
math_ldbl.h
math_private_calls.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math_private.h Enable inlining issignalingf within glibc 2019-11-21 09:39:48 -06:00
math-barriers.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-nan-payload-double.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-nan-payload-float.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests-arch.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests-exceptions.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests-rounding.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests-snan-cast.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests-snan-payload.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests-snan.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests-trap-force.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests-trap.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-tests.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-type-macros-double.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-type-macros-float128.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-type-macros-float.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-type-macros-ldouble.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math-type-macros.h Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
math-use-builtins.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcopy.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mmap_info.h posix: Fix large mmap64 offset for mips64n32 (BZ#24699) 2019-07-10 16:52:50 -03:00
nan-high-order-bit.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
not-cancel.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
not-errno.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
nscd-types.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
pagecopy.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
paths.h
profil-counter.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
pty-private.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
register-dump.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
rtld-lowlevel.h
safe-fatal.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
setjmpP.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sigcontextinfo.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
siglist.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sigset-cvt-mask.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sigsetops.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
single-thread.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stackguard-macros.h
stackinfo.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stap-probe-machine.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
startup.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stdio-lock.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
string_private.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
symbol-hacks.h Break more lines before not after operators. 2019-02-25 13:19:19 +00:00
sysdep-cancel.h nptl: Remove tst-cancel-wrappers test and related macros 2019-01-03 18:38:08 -02:00
sysdep.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
thread_state.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
time-clockid.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
tininess.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
tls-macros.h
tls-setup.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
tls.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
tst-audit.h
tst-stack-align.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
unsecvars.h
unwind-dw2-fde-glibc.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
unwind-dw2-fde.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
unwind-dw2-fde.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
unwind-dw2.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
unwind-pe.c
unwind-pe.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
unwind-resume.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
unwind.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
utmp-equal.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00