aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorBrandon Bergren <bdragon@FreeBSD.org>2019-09-14 21:18:10 +0000
committerBrandon Bergren <bdragon@FreeBSD.org>2019-09-14 21:18:10 +0000
commitd020b3ebded332d4f073bdb51c1d0c6fa98f756a (patch)
tree3113f7d4195550c3c18c5165bd6955728f9c87ff /libexec
parentb897b02c6c27d60a836759d2e918cf0e0bf0a6fd (diff)
downloadsrc-d020b3ebded332d4f073bdb51c1d0c6fa98f756a.tar.gz
src-d020b3ebded332d4f073bdb51c1d0c6fa98f756a.zip
Fix aux_info corruption in rtld direct execution mode.
After the aux vector is moved, it is necessary to re-digest aux_info so the pointers are updated to the new locations. This was causing thread creation to fail on powerpc64 when using direct execution due to a nonsense value being read for aux_info[AT_STACKPROT]. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D21656
Notes
Notes: svn path=/head/; revision=352340
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index a42192dce8db..46bf1efddbd1 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -499,6 +499,13 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
if (auxp->a_type == AT_NULL)
break;
}
+ /* Since the auxiliary vector has moved, redigest it. */
+ for (i = 0; i < AT_COUNT; i++)
+ aux_info[i] = NULL;
+ for (auxp = aux; auxp->a_type != AT_NULL; auxp++) {
+ if (auxp->a_type < AT_COUNT)
+ aux_info[auxp->a_type] = auxp;
+ }
} else {
_rtld_error("No binary");
rtld_die();