From 77523d5e43cb5721c23855eb6045b0607a3b30a0 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 4 Oct 2019 21:23:51 +0200 Subject: 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 --- ChangeLog | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index d2156e5fb0..a1da75b0f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2019-10-04 Florian Weimer + + [BZ #24930] + * elf/dl-load.c (_dl_map_object_from_fd): Only assign TLS modid if + the link map will be returned to the caller. + * elf/Makefile [$(have-fpie) && $(build-shared)] (tests, tests-pie): + Add tst-dlopen-aout-pie. + (tst-tst-dlopen-aout-no-pie): Set. + (CFLAGS-tst-dlopen-aout-pie.c): Build with -fpie. + (tst-dlopen-aout-pie): Link with -ldl -lpthread. + * elf/tst-dlopen-aout-pie.c: New file. + 2019-10-04 Florian Weimer [BZ #24900] -- cgit 1.4.1