diff options
author | Florian Weimer <fweimer@redhat.com> | 2015-10-06 13:12:36 +0200 |
---|---|---|
committer | Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> | 2016-07-11 13:53:12 -0300 |
commit | 66986dec455c2011085a04b72a5bd55d9f9c7d1c (patch) | |
tree | 275ba79b1220c9cf0cd3901b5fce11975968fdee /stdlib | |
parent | dea992adae5ff1194d7e49b698424eba741df62a (diff) | |
download | glibc-66986dec455c2011085a04b72a5bd55d9f9c7d1c.zip glibc-66986dec455c2011085a04b72a5bd55d9f9c7d1c.tar.gz glibc-66986dec455c2011085a04b72a5bd55d9f9c7d1c.tar.bz2 |
Harden tls_dtor_list with pointer mangling [BZ #19018]
(cherry picked from commit f586e1328681b400078c995a0bb6ad301ef73549)
Conflicts:
NEWS
stdlib/cxa_thread_atexit_impl.c
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/cxa_thread_atexit_impl.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/stdlib/cxa_thread_atexit_impl.c b/stdlib/cxa_thread_atexit_impl.c index d2f88d3..6030e5f 100644 --- a/stdlib/cxa_thread_atexit_impl.c +++ b/stdlib/cxa_thread_atexit_impl.c @@ -42,6 +42,10 @@ static __thread struct link_map *lm_cache; int __cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol) { +#ifdef PTR_MANGLE + PTR_MANGLE (func); +#endif + /* Prepend. */ struct dtor_list *new = calloc (1, sizeof (struct dtor_list)); new->func = func; @@ -83,9 +87,13 @@ __call_tls_dtors (void) while (tls_dtor_list) { struct dtor_list *cur = tls_dtor_list; - tls_dtor_list = tls_dtor_list->next; + dtor_func func = cur->func; +#ifdef PTR_DEMANGLE + PTR_DEMANGLE (func); +#endif - cur->func (cur->obj); + tls_dtor_list = tls_dtor_list->next; + func (cur->obj); __rtld_lock_lock_recursive (GL(dl_load_lock)); |