* [PATCH] Fix LD_AUDIT=foo.so:bar.so /bin/true
@ 2007-06-18 15:47 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2007-06-18 15:47 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
When audit_list contains more than one list entry, init_tls is called
multiple times which screws up all TLS handling. When it is called the
second time, it will change GL(dl_tls_static_nelem) and then return
NULL as GL(dl_initial_dtv) != NULL. As tcbp is set to that unconditionally,
init_tls will be called after that loop once again, changing
GL(dl_tls_static_nelem) again.
This patch cures it.
2007-06-18 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (dl_main): Don't call init_tls more than once.
--- libc/elf/rtld.c.jj 2007-06-18 15:27:28.000000000 +0200
+++ libc/elf/rtld.c 2007-06-18 17:10:14.000000000 +0200
@@ -1400,6 +1400,11 @@ of this helper program; chances are you
/* Iterate over all entries in the list. The order is important. */
struct audit_ifaces *last_audit = NULL;
struct audit_list *al = audit_list->next;
+
+ /* Since we start using the auditing DSOs right away we need to
+ initialize the data structures now. */
+ tcbp = init_tls ();
+
do
{
int tls_idx = GL(dl_tls_max_dtv_idx);
@@ -1410,10 +1415,6 @@ of this helper program; chances are you
no DF_STATIC_TLS bit is set. The reason is that we know
glibc will use the static model. */
- /* Since we start using the auditing DSOs right away we need to
- initialize the data structures now. */
- tcbp = init_tls ();
-
struct dlmopen_args dlmargs;
dlmargs.fname = al->name;
dlmargs.map = NULL;
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-06-18 15:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-18 15:47 [PATCH] Fix LD_AUDIT=foo.so:bar.so /bin/true Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).