mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
dlfcn: dlerror needs to call free from the base namespace [BZ #24773]
Calling free directly may end up freeing a pointer allocated by the dynamic loader using malloc from libc.so in the base namespace using the allocator from libc.so in a secondary namespace, which results in crashes. This commit redirects the free call through GLRO and the dynamic linker, to reach the correct namespace. It also cleans up the dlerror handling along the way, so that pthread_setspecific is no longer needed (which avoids triggering bug 24774).
This commit is contained in:
@ -369,6 +369,7 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
|
||||
._dl_open = _dl_open,
|
||||
._dl_close = _dl_close,
|
||||
._dl_catch_error = _rtld_catch_error,
|
||||
._dl_error_free = _dl_error_free,
|
||||
._dl_tls_get_addr_soft = _dl_tls_get_addr_soft,
|
||||
#ifdef HAVE_DL_DISCOVER_OSVERSION
|
||||
._dl_discover_osversion = _dl_discover_osversion
|
||||
|
Reference in New Issue
Block a user