]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: Avoid some free (NULL) calls in _dl_update_slotinfo
authorFlorian Weimer <fweimer@redhat.com>
Mon, 3 Jun 2024 08:49:40 +0000 (10:49 +0200)
committerSunil K Pandey <skpgkp2@gmail.com>
Sat, 11 Jan 2025 03:47:37 +0000 (19:47 -0800)
commit19d8959b4dd0bea1e926c6db504c80fcb90ecbce
tree4b04bd8546e7f85f0c03609a7da8cbf2088f4f60
parent7d1c95058255466d1639af09ad21fd5bcd2c4cc1
elf: Avoid some free (NULL) calls in _dl_update_slotinfo

This has been confirmed to work around some interposed mallocs.  Here
is a discussion of the impact test ust/libc-wrapper/test_libc-wrapper
in lttng-tools:

  New TLS usage in libgcc_s.so.1, compatibility impact
  <https://inbox.sourceware.org/libc-alpha/8734v1ieke.fsf@oldenburg.str.redhat.com/>

Reportedly, this patch also papers over a similar issue when tcmalloc
2.9.1 is not compiled with -ftls-model=initial-exec.  Of course the
goal really should be to compile mallocs with the initial-exec TLS
model, but this commit appears to be a useful interim workaround.

Fixes commit d2123d68275acc0f061e73d5f86ca504e0d5a344 ("elf: Fix slow
tls access after dlopen [BZ #19924]").

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit afe42e935b3ee97bac9a7064157587777259c60e)
elf/dl-tls.c