Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Sep 2019 21:18:10 +0000 (UTC)
From:      Brandon Bergren <bdragon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352340 - head/libexec/rtld-elf
Message-ID:  <201909142118.x8ELIA4L017409@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdragon
Date: Sat Sep 14 21:18:10 2019
New Revision: 352340
URL: https://svnweb.freebsd.org/changeset/base/352340

Log:
  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

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Sat Sep 14 20:26:50 2019	(r352339)
+++ head/libexec/rtld-elf/rtld.c	Sat Sep 14 21:18:10 2019	(r352340)
@@ -499,6 +499,13 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
 		    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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909142118.x8ELIA4L017409>