about summary refs log tree commit diff
path: root/sysdeps/nptl
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2018-04-26 10:41:43 -0300
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2018-04-26 10:41:43 -0300
commit81b49e969233ac5b9faf5c043bb0cc64bf9d6271 (patch)
tree5cd448f269f2206f15da2af3995e13be3bbfd2ec /sysdeps/nptl
parent7d80f48e93508476d0d17d368b34b28cd5dda2a5 (diff)
downloadglibc-81b49e969233ac5b9faf5c043bb0cc64bf9d6271.tar.gz
glibc-81b49e969233ac5b9faf5c043bb0cc64bf9d6271.tar.xz
glibc-81b49e969233ac5b9faf5c043bb0cc64bf9d6271.zip
Increase robustness of internal dlopen() by using RTLD_NOW [BZ #22766]
Prevent random runtime crashes due to missing symbols caused by mixed
libnss_* versions.

	[BZ #22766]
	* include/dlfcn.h [__libc_dl_open]: Replace RTLD_LAZY with RTLD_NOW.
	* sysdeps/gnu/unwind-resume.c (__lib_gcc_s_init): Replace
	__libc_dlopen_mode() using RTLD_NOW with __libc_dlopen.
	* sysdeps/nptl/unwind-forcedunwind.c: Likewise.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/nptl')
-rw-r--r--sysdeps/nptl/unwind-forcedunwind.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/nptl/unwind-forcedunwind.c b/sysdeps/nptl/unwind-forcedunwind.c
index 67b8e74b53..0621c8002f 100644
--- a/sysdeps/nptl/unwind-forcedunwind.c
+++ b/sysdeps/nptl/unwind-forcedunwind.c
@@ -49,7 +49,8 @@ pthread_cancel_init (void)
       return;
     }
 
-  handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN);
+  /* See include/dlfcn.h. Use of __libc_dlopen requires RTLD_NOW.  */
+  handle = __libc_dlopen (LIBGCC_S_SO);
 
   if (handle == NULL
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL