]> git.ipfire.org Git - thirdparty/glibc.git/commit - elf/Makefile
elf: Assign TLS modid later during dlopen [BZ #24930]
authorFlorian Weimer <fweimer@redhat.com>
Fri, 4 Oct 2019 19:23:51 +0000 (21:23 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 4 Oct 2019 19:23:51 +0000 (21:23 +0200)
commit77523d5e43cb5721c23855eb6045b0607a3b30a0
treea692226cc266966f729a9694bb174d067f6f3b72
parent2b26b084e4e4ba58a2ff9f8f8f14c9bca506bd59
elf: Assign TLS modid later during dlopen [BZ #24930]

Commit a42faf59d6d9f82e5293a9ebcc26d9c9e562b12b ("Fix BZ #16634.")
attempted to fix a TLS modid consistency issue by adding additional
checks to the open_verify function.  However, this is fragile
because open_verify cannot reliably predict whether
_dl_map_object_from_fd will later fail in the more complex cases
(such as memory allocation failures).  Therefore, this commit
assigns the TLS modid as late as possible.  At that point, the link
map pointer will eventually be passed to _dl_close, which will undo
the TLS modid assignment.

Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
ChangeLog
elf/Makefile
elf/dl-load.c
elf/tst-dlopen-aout-pie.c [new file with mode: 0644]