glibc/dlfcn
Mark Wielaard e3f828b8bd dlfcn: Guard __dlerror_main_freeres with __libc_once_get (once) [BZ#24476]
dlerror.c (__dlerror_main_freeres) will try to free resources which only
have been initialized when init () has been called. That function is
called when resources are needed using __libc_once (once, init) where
once is a __libc_once_define (static, once) in the dlerror.c file.
Trying to free those resources if init () hasn't been called will
produce errors under valgrind memcheck. So guard the freeing of those
resources using __libc_once_get (once) and make sure we have a valid
key. Also add a similar guard to __dlerror ().

	* dlfcn/dlerror.c (__dlerror_main_freeres): Guard using
	__libc_once_get (once) and static_bug == NULL.
	(__dlerror): Check we have a valid key, set result to static_buf
	otherwise.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 11b451c886)
2019-05-16 14:54:23 +02:00
..
bug-atexit1-lib.c
bug-atexit1.c
bug-atexit2-lib.c
bug-atexit2.c
bug-atexit3-lib.cc
bug-atexit3.c
bug-dl-leaf-lib-cb.c
bug-dl-leaf-lib.c
bug-dl-leaf.c
bug-dlopen1.c
bug-dlsym1-lib1.c
bug-dlsym1-lib2.c
bug-dlsym1.c
default.c
defaultmod1.c
defaultmod2.c
dladdr1.c
dladdr.c
dlclose.c
dlerror.c
dlfcn.c
dlfcn.h
dlfreeres.c
dlinfo.c
dlmopen.c
dlopen.c
dlopenold.c
dlsym.c
dlvsym.c
errmsg1.c
errmsg1mod.c
failtest.c
failtestmod.c
glreflib1.c
glreflib2.c
glreflib3.c
glrefmain.c
Makefile
modatexit.c
modcxaatexit.c
moddummy1.c
moddummy2.c
modstatic2.c
modstatic3.c
modstatic5.c
modstatic.c
sdladdr1.c
sdladdr.c
sdlclose.c
sdlerror.c
sdlfreeres.c
sdlinfo.c
sdlmopen.c
sdlopen.c
sdlsym.c
sdlvsym.c
tst-dladdr.c
tst-dlinfo.c
tst-rec-dlopen.c
tstatexit.c
tstcxaatexit.c
tststatic2.c
tststatic3.c
tststatic4.c
tststatic5.c
tststatic.c
Versions