freebsd-dev/libexec/rtld-elf
Konstantin Belousov 9fee0541f2 Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and
phdr locks locked.  This allows to call rtld services from the
callback, which is only reasonable for dlopen(path, RTLD_NOLOAD) to
test existence of the library in the image, and for dlsym().  The
later might still be not quite safe, due to the lazy resolution of
filters.

To allow dropping the locks around iteration in dl_iterate_phdr(3), we
insert markers to track current position between relocks.  The global
objects list is converted to tailq and all iterators skip markers,
globallist_next() and globallist_curr() helpers are added.

Reported and tested by:	davide
Reviewed by:	kan
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2016-01-20 07:21:33 +00:00
..
aarch64 Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
amd64 Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
arm Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
i386 Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
mips Create a generalized exec hook that different architectures can hook 2016-01-03 04:32:02 +00:00
powerpc Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
powerpc64 Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
riscv Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
sparc64 Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
tests Fix LDADD/DPADD that should be LIBADD. 2015-12-04 03:17:47 +00:00
debug.c Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
debug.h
libmap.c
libmap.h
Makefile
Makefile.depend
malloc.c
map_object.c
paths.h Restore ABI variants now that ldconfig groks -soft. In addition, as a 2016-01-18 21:40:20 +00:00
rtld_lock.c
rtld_lock.h
rtld_printf.c
rtld_printf.h
rtld_tls.h
rtld.1
rtld.c Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
rtld.h Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
Symbol.map
xmalloc.c