freebsd-dev/lib/libthr
Konstantin Belousov bd43f0691c If libthr.so is dlopened without RTLD_GLOBAL flag, the libthr symbols
do not participate in the global symbols namespace, but rtld locks are
still replaced and functions are interposed.  In particular,
__pthread_map_stacks_exec is resolved to the libc version.  If a
library is loaded later, which requires adjustment of the stack
protection mode, rtld calls into libc __pthread_map_stacks_exec due to
the symbols scope.  The libc version might recurse into binder and
recursively acquire rtld bind lock, causing the hang.

Make libc __pthread_map_stacks_exec() interposed, which synchronizes
rtld locks and version of the stack exec hook when libthr loaded,
regardless of the symbol scope control or symbol resolution order.

The __pthread_map_stacks_exec() symbol is removed from the private
version in libthr since libc symbol now operates correctly in presence
of libthr.

Reported and tested by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2016-02-08 19:24:13 +00:00
..
arch Add pthread MD part for RISC-V. 2016-01-27 14:10:50 +00:00
support Merge from tbemd, with a small amount of rework: 2010-09-13 01:43:10 +00:00
sys Fix known issues which blow up the process after dlopen("libthr.so") 2015-01-03 18:38:46 +00:00
tests Fix LDADD/DPADD that should be LIBADD. 2015-12-04 03:17:47 +00:00
thread If libthr.so is dlopened without RTLD_GLOBAL flag, the libthr symbols 2016-02-08 19:24:13 +00:00
libthr.3 Update libthr(3) man page to reflect the work done to support dlopen. 2015-02-12 17:16:54 +00:00
Makefile Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
Makefile.depend META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host. 2015-11-25 19:10:28 +00:00
plockstat.d Add the DTrace probe definitions for plockstat support. 2014-07-05 19:49:31 +00:00
pthread.map If libthr.so is dlopened without RTLD_GLOBAL flag, the libthr symbols 2016-02-08 19:24:13 +00:00