[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r6568 - in glibc-package/trunk/debian: . patches patches/any



Author: aurel32
Date: 2015-09-13 16:39:28 +0000 (Sun, 13 Sep 2015)
New Revision: 6568

Added:
   glibc-package/trunk/debian/patches/any/cvs-pie-lt_executable.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
patches/any/cvs-pie-lt_executable.diff: new patch from upstream to fix
explicit loader invocation with PIE binaries.  Closes: #796899.

Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2015-09-13 16:29:21 UTC (rev 6567)
+++ glibc-package/trunk/debian/changelog	2015-09-13 16:39:28 UTC (rev 6568)
@@ -41,6 +41,8 @@
     - Add patches/hppa/local-fptr-table-size.diff from Carlos O'Donnell.
     - Add patches/hppa/local-setcontext.diff.
     - Add patches/hppa/cvs-start.diff from upstream.
+  * patches/any/cvs-pie-lt_executable.diff: new patch from upstream to fix
+    explicit loader invocation with PIE binaries.  Closes: #796899.
 
  -- Samuel Thibault <sthibault@debian.org>  Sun, 09 Aug 2015 20:00:16 +0000
 

Added: glibc-package/trunk/debian/patches/any/cvs-pie-lt_executable.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/cvs-pie-lt_executable.diff	                        (rev 0)
+++ glibc-package/trunk/debian/patches/any/cvs-pie-lt_executable.diff	2015-09-13 16:39:28 UTC (rev 6568)
@@ -0,0 +1,67 @@
+2014-03-12  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+	[BZ #16381]
+
+	* elf/Makefile (tests): Add tst-pie2.
+        (tests-pie): Add tst-pie2.
+	* elf/tst-pie2.c: New file.
+	* elf/dl-load.c (_dl_map_object_from_fd): Assert correct l_type
+	for ET_EXEC.
+	* elf/rtld.c (map_doit): Load executable as lt_executable.
+	(dl_main): Likewise.
+
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -218,8 +218,8 @@
+ 		tst-array5dep tst-null-argv-lib
+ ifeq (yesyes,$(have-fpie)$(build-shared))
+ modules-names += tst-piemod1
+-tests += tst-pie1
+-tests-pie += tst-pie1
++tests += tst-pie1 tst-pie2
++tests-pie += tst-pie1 tst-pie2
+ endif
+ modules-execstack-yes = tst-execstack-mod
+ extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
+@@ -886,6 +886,7 @@
+ 	cmp $@ tst-array5-static.exp > /dev/null
+ 
+ CFLAGS-tst-pie1.c += $(pie-ccflag)
++CFLAGS-tst-pie2.c += $(pie-ccflag)
+ 
+ $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so
+ 
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -1534,8 +1534,8 @@
+   /* Signal that we closed the file.  */
+   fd = -1;
+ 
+-  if (l->l_type == lt_library && type == ET_EXEC)
+-    l->l_type = lt_executable;
++  /* If this is ET_EXEC, we should have loaded it as lt_executable.  */
++  assert (type != ET_EXEC || l->l_type == lt_executable);
+ 
+   l->l_entry += l->l_addr;
+ 
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -623,7 +623,8 @@
+ map_doit (void *a)
+ {
+   struct map_args *args = (struct map_args *) a;
+-  args->map = _dl_map_object (args->loader, args->str, lt_library, 0,
++  int type = (args->mode == __RTLD_OPENEXEC) ? lt_executable : lt_library;
++  args->map = _dl_map_object (args->loader, args->str, type, 0,
+ 			      args->mode, LM_ID_BASE);
+ }
+ 
+@@ -1075,7 +1076,7 @@
+       else
+ 	{
+ 	  HP_TIMING_NOW (start);
+-	  _dl_map_object (NULL, rtld_progname, lt_library, 0,
++	  _dl_map_object (NULL, rtld_progname, lt_executable, 0,
+ 			  __RTLD_OPENEXEC, LM_ID_BASE);
+ 	  HP_TIMING_NOW (stop);
+ 

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series	2015-09-13 16:29:21 UTC (rev 6567)
+++ glibc-package/trunk/debian/patches/series	2015-09-13 16:39:28 UTC (rev 6568)
@@ -283,3 +283,4 @@
 any/cvs-vfprintf.diff
 any/cvs-wscanf.diff
 any/cvs-ldconfig-aux-cache.diff
+any/cvs-pie-lt_executable.diff


Reply to: