glibc/sysdeps/generic
Florian Weimer a509eb117f Avoid late dlopen failure due to scope, TLS slotinfo updates [BZ #25112]
This change splits the scope and TLS slotinfo updates in dlopen into
two parts: one to resize the data structures, and one to actually apply
the update.  The call to add_to_global_resize in dl_open_worker is moved
before the demarcation point at which no further memory allocations are
allowed.

_dl_add_to_slotinfo is adjusted to make the list update optional.  There
is some optimization possibility here because we could grow the slotinfo
list of arrays in a single call, one the largest TLS modid is known.

This commit does not fix the fatal meory allocation failure in
_dl_update_slotinfo.  Ideally, this error during dlopen should be
recoverable.

The update order of scopes and TLS data structures is retained, although
it appears to be more correct to fully initialize TLS first, and then
expose symbols in the newly loaded objects via the scope update.

Tested on x86_64-linux-gnu.

Change-Id: I240c58387dabda3ca1bcab48b02115175fa83d6c
2019-11-27 20:55:35 +01:00
..
net Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
netinet Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
nfs Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sys Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
_G_config.h
_itoa.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
a.out.h
abort-instr.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
adaptive_spin_count.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
aio_misc.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
allocalim.h
asm-syntax.h
atomic-machine.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
c++-types.data
confstr.h
device-nrs.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dirstream.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-cache.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-dtprocnum.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-dtv.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-fcntl.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-fileid.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-fptr.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-hash.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-irel.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-librecon.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-lookupcfg.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-machine.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-mman.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-osinfo.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-procinfo.c
dl-procinfo.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-procruntime.c
dl-prop.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-sysdep.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-tls.h
dl-unistd.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dwarf2.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
elide.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
eloop-threshold.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
entry.h
errqueue.h
exit-thread.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fd_to_filename.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fenv_private.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fips-private.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fix-fp-int-compare-invalid.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fix-fp-int-convert-overflow.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fix-int-fp-convert-zero.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
float128-abi.h
fork.h
fpu_control.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
framestate.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
gcc-compat.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
gccframe.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
get-rounding-mode.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
gmp-mparam.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
hp-timing-common.h Fix small error in HP_TIMING_PRINT trailing null char setting 2019-09-17 17:50:11 +08:00
hp-timing.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ifreq.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ifunc-init.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ifunc-sel.h
internal-signals.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
intr-msg.h
ld.abilist
ldbl-classify-compat.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ldconfig.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ldsodefs.h Avoid late dlopen failure due to scope, TLS slotinfo updates [BZ #25112] 2019-11-27 20:55:35 +01:00
libanl.abilist
libBrokenLocale.abilist
libc-lock.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc-mmap.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc-start.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc-tsd.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc.abilist
libcrypt.abilist
libdl.abilist
libm-alias-double.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libm-alias-float128.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libm-alias-float.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libm-alias-ldouble.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
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
machine-gmon.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
machine-lock.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
machine-sp.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Makefile Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
malloc-alignment.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
malloc-machine.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
malloc-sysdep.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math_ldbl_opt.h
math_ldbl.h
math_private_calls.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math_private.h Enable inlining issignalingf within glibc 2019-11-21 09:39:48 -06:00
math-barriers.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-nan-payload-double.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-nan-payload-float.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests-arch.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests-exceptions.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests-rounding.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests-snan-cast.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests-snan-payload.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests-snan.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests-trap-force.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests-trap.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-tests.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-type-macros-double.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-type-macros-float128.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-type-macros-float.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-type-macros-ldouble.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math-type-macros.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
memcopy.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
memusage.h Change most internal uses of __gettimeofday to __clock_gettime. 2019-10-30 17:04:10 -03:00
mmap_info.h
nan-high-order-bit.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
not-cancel.h Remove pause and nanosleep not cancel wrappers 2019-10-31 11:09:06 -03:00
not-errno.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
nscd-types.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
pagecopy.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
paths.h
profil-counter.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
pty-private.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
register-dump.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
rtld-lowlevel.h
safe-fatal.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
setjmpP.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sigcontextinfo.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
siglist.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sigset-cvt-mask.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sigsetops.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
single-thread.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
stackguard-macros.h
stackinfo.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
stap-probe-machine.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
startup.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
stdio-lock.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
string_private.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
symbol-hacks.h
sysdep-cancel.h
sysdep.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
thread_state.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
time-clockid.h Use clock_gettime to implement time. 2019-10-30 17:05:14 -03:00
tininess.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tls-macros.h
tls-setup.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tls.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-audit.h
tst-stack-align.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
unsecvars.h
unwind-dw2-fde-glibc.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
unwind-dw2-fde.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
unwind-dw2-fde.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
unwind-dw2.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
unwind-pe.c
unwind-pe.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
unwind-resume.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
unwind.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
utmp-equal.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00