freebsd-dev/libexec/rtld-elf
Ryan Stone 68faee11e8 rtld: Fix segfault in direct exec mode
When rtld is directly executed with arguments, it has to move the
program arguments, environment and elf aux data up a few slots to
remove its own arguments before the process being executed sees
them.  When copying the environment, rtld was incorrectly testing
whether the location about to be written to currently contained
NULL, when was supposed to check whether it had just copied the
NULL terminator of the environment string.  This had the result
that the ELF aux data was mostly treated as environment variables,
and rtld would quickly crash when it tried to access required
ELF aux data that it didn't think was present.

Differential Revision:	https://reviews.freebsd.org/D23008
Reviewed by:	kib
MFC after:	1 month
2020-01-07 16:03:11 +00:00
..
aarch64 Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +00:00
amd64 rtld-elf: Remove x86 elf_rtld.x linker scripts. 2019-08-04 21:43:34 +00:00
arm rtld: attempt to fix reloc_nonplt_object TLS allocation 2019-03-29 14:35:23 +00:00
i386 rtld-elf: Remove x86 elf_rtld.x linker scripts. 2019-08-04 21:43:34 +00:00
mips rtld: attempt to fix reloc_non_plt TLS allocation on MIPS 2019-03-29 15:07:00 +00:00
powerpc [PowerPC] powerpc32 rtld IFUNC handling code 2019-12-24 16:13:15 +00:00
powerpc64 [PowerPC] powerpc64 rtld IFUNC handling code 2019-12-24 16:07:35 +00:00
riscv Correct the offset of static TLS variables for Initial-Exec on RISC-V. 2019-12-10 21:56:44 +00:00
rtld-libc rtld-elf: fix build with xtoolchain-llvm90 2019-08-15 17:35:24 +00:00
sparc64 Improve R_AARCH64_TLSDESC relocation. 2018-12-15 10:38:07 +00:00
tests Fix regression tests broken by r337067. 2018-08-02 11:55:16 +00:00
debug.c libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
debug.h Use rtld_putstr() instead of write() for the rtld msg() macro 2019-06-26 15:43:26 +00:00
libmap.c Reduce size of rtld by 22% by pulling in less code from libc 2019-06-30 11:49:58 +00:00
libmap.conf Move libmap.conf to libexec/rtld-elf/ 2018-09-18 00:25:00 +00:00
libmap.h rtld-elf: make it compile with WARNS=3 2018-10-29 21:08:11 +00:00
Makefile libcompat: Correct rtld MLINKS 2019-11-12 22:31:59 +00:00
Makefile.depend new depends 2015-06-16 23:37:19 +00:00
map_object.c rtld: make checks for mmap(2) failures compliant with documentation. 2019-12-12 22:59:22 +00:00
paths.h rtld-elf: compile with WANRS=4 warnings other than -Wcast-align 2018-10-29 21:08:19 +00:00
rtld_lock.c Reduce size of rtld by 22% by pulling in less code from libc 2019-06-30 11:49:58 +00:00
rtld_lock.h libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rtld_malloc.c Remove remnants of optimization for > pagesize allocations. 2019-09-02 08:03:29 +00:00
rtld_malloc.h Add header file missed in r343564. 2019-01-29 22:45:24 +00:00
rtld_printf.c Reduce size of rtld by 22% by pulling in less code from libc 2019-06-30 11:49:58 +00:00
rtld_printf.h Use rtld_putstr() instead of write() for the rtld msg() macro 2019-06-26 15:43:26 +00:00
rtld_tls.h libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rtld_utrace.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
rtld.1 Add serial comma. 2017-09-01 16:56:37 +00:00
rtld.c rtld: Fix segfault in direct exec mode 2020-01-07 16:03:11 +00:00
rtld.h rtld(1): Do booleans like C99 2019-12-31 05:41:47 +00:00
Symbol.map Add rtld private interface for dso to detect dynamic loading 2015-01-03 18:09:53 +00:00
xmalloc.c Reduce size of rtld by 22% by pulling in less code from libc 2019-06-30 11:49:58 +00:00