From ccdb048df457d581f6ac7ede8b0c7a593a891dfa Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Wed, 21 Jan 2015 01:51:10 -0500 Subject: Fix recursive dlopen. The ability to recursively call dlopen is useful for malloc implementations that wish to load other dynamic modules that implement reentrant/AS-safe functions to use in their own implementation. Given that a user malloc implementation may be called by an ongoing dlopen to allocate memory the user malloc implementation interrupts dlopen and if it calls dlopen again that's a reentrant call. This patch fixes the issues with the ld.so.cache mapping and the _r_debug assertion which prevent this from working as expected. See: https://sourceware.org/ml/libc-alpha/2014-12/msg00446.html --- ChangeLog | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 030491a270..d83be7a788 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2015-01-21 Carlos O'Donell + + [BZ #17702] + * dlfcn/Makefile (tests): Add tst-rec-dlopen. + (modules-names): Add moddummy1 and moddummy2. + ($(objpfx)tst-rec-dlopen): Define. + * dlfcn/moddummy1.c: New file. + * dlfcn/moddummy2.c: New file. + * dlfcn/tst-rec-dlopen.c: New file. + * elf/dl-cache.c (_dl_load_cache_lookup): + Return char*. Copy result with alloca/strcpy/strdup. + * elf/dl-load.c (_dl_map_object): _dl_load_cached_lookup + returns char*. Free cached. If not saving realname + free cached. + * elf/dl-open.c (dl_open_worker): Do not assert that + _r_debug->r_state is RT_CONSISTENT. + * sysdeps/generic/ldsodefs.h: _dl_load_cache_lookup + returns char*. + 2015-01-21 Torvald Riegel Carlos O'Donell -- cgit 1.4.1