[v5,0/2] elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717)

Message ID cover.1719420465.git.fweimer@redhat.com
Headers
Series elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717) |

Message

Florian Weimer June 26, 2024, 4:49 p.m. UTC
  This version fixes an unexpected interaction with the handling of
l_need_tls_init for initially-loaded objects, and fixes the tests
accordingly.

Tested on x86_64-linux-gnu.

Thanks,
Florian

Florian Weimer (2):
  elf: Clarify and invert second argument of _dl_allocate_tls_init
  elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717)

 elf/Makefile                   |  30 ++++++++++
 elf/dl-open.c                  |  35 ++---------
 elf/dl-tls.c                   |  34 ++++++-----
 elf/rtld.c                     |   2 +-
 elf/tst-dlopen-tlsreinit1.c    |  40 +++++++++++++
 elf/tst-dlopen-tlsreinit2.c    |  39 +++++++++++++
 elf/tst-dlopen-tlsreinit3.c    |   2 +
 elf/tst-dlopen-tlsreinit4.c    |   2 +
 elf/tst-dlopen-tlsreinitmod1.c |  20 +++++++
 elf/tst-dlopen-tlsreinitmod2.c |  30 ++++++++++
 elf/tst-dlopen-tlsreinitmod3.c | 102 +++++++++++++++++++++++++++++++++
 include/link.h                 |   1 +
 nptl/allocatestack.c           |   2 +-
 sysdeps/generic/ldsodefs.h     |  39 ++++++++++---
 14 files changed, 325 insertions(+), 53 deletions(-)
 create mode 100644 elf/tst-dlopen-tlsreinit1.c
 create mode 100644 elf/tst-dlopen-tlsreinit2.c
 create mode 100644 elf/tst-dlopen-tlsreinit3.c
 create mode 100644 elf/tst-dlopen-tlsreinit4.c
 create mode 100644 elf/tst-dlopen-tlsreinitmod1.c
 create mode 100644 elf/tst-dlopen-tlsreinitmod2.c
 create mode 100644 elf/tst-dlopen-tlsreinitmod3.c


base-commit: a10b6ad471d7b528149f5ff32eef2f1c1dc1213c