r2308 - trunk/glibc

robert at linuxfromscratch.org robert at linuxfromscratch.org
Sat Aug 13 21:08:30 PDT 2011


Author: robert
Date: 2011-08-13 22:08:25 -0600 (Sat, 13 Aug 2011)
New Revision: 2308

Added:
   trunk/glibc/glibc-2.12.2-dl_execstack-1.patch
   trunk/glibc/glibc-2.12.2-localedef_trampoline-1.patch
   trunk/glibc/glibc-2.12.2-pt_pax-1.patch
Log:
Add PaX patches for Glibc

Added: trunk/glibc/glibc-2.12.2-dl_execstack-1.patch
===================================================================
--- trunk/glibc/glibc-2.12.2-dl_execstack-1.patch	                        (rev 0)
+++ trunk/glibc/glibc-2.12.2-dl_execstack-1.patch	2011-08-14 04:08:25 UTC (rev 2308)
@@ -0,0 +1,74 @@
+Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
+Date: 2011-08-13
+Initial Package Version: 2.12.2
+Upstream Status: Not submitted - PaX specific. Will not be accepted upstream.
+Origin:
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/2.12.2/3000_all_2.3.6-dl_execstack-PaX-support.patch?view=markup
+Description:
+
+	With latest versions of glibc, a lot of apps failed on a PaX enabled
+	system with:
+		cannot enable executable stack as shared object requires: Permission denied
+
+	This is due to PaX 'exec-protecting' the stack, and ld.so then trying
+	to make the stack executable due to some libraries not containing the
+	PT_GNU_STACK section.  Bug #32960.  <azarah at gentoo.org> (12 Nov 2003).
+
+	Patch also NPTL. Bug #116086. <kevquinn at gentoo.org> (20 Dec 2005).
+
+diff -Naur glibc-2.12.2.orig/nptl/allocatestack.c glibc-2.12.2/nptl/allocatestack.c
+--- glibc-2.12.2.orig/nptl/allocatestack.c	2010-12-13 10:47:26.000000000 +0000
++++ glibc-2.12.2/nptl/allocatestack.c	2011-08-14 03:30:30.368648803 +0000
+@@ -329,7 +329,8 @@
+ # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
+ #endif
+   if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
+-    return errno;
++    if (errno != EACCES) /* PAX is enabled */
++    	return errno;
+ 
+   return 0;
+ }
+diff -Naur glibc-2.12.2.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2.12.2/sysdeps/unix/sysv/linux/dl-execstack.c
+--- glibc-2.12.2.orig/sysdeps/unix/sysv/linux/dl-execstack.c	2010-12-13 10:47:26.000000000 +0000
++++ glibc-2.12.2/sysdeps/unix/sysv/linux/dl-execstack.c	2011-08-14 03:30:30.367648794 +0000
+@@ -63,7 +63,10 @@
+       else
+ # endif
+ 	{
+-	  result = errno;
++	  if (errno == EACCES)  /* PAX is enabled */
++	    result = 0;
++	  else
++	    result = errno;
+ 	  goto out;
+ 	}
+     }
+@@ -89,7 +92,12 @@
+ 	page -= size;
+       else
+ 	{
+-	  if (errno != ENOMEM)	/* Unexpected failure mode.  */
++	  if (errno == EACCES)		/* PAX is enabled */
++	    {
++	      result = 0;
++	      goto out;
++	    }
++	  else if (errno != ENOMEM)	/* Unexpected failure mode.  */
+ 	    {
+ 	      result = errno;
+ 	      goto out;
+@@ -115,7 +123,12 @@
+ 	page += size;
+       else
+ 	{
+-	  if (errno != ENOMEM)	/* Unexpected failure mode.  */
++	  if (errno == EACCES)		/* PAX is enabled */
++	    {
++	      result = 0;
++	      goto out;
++	    }
++	  else if (errno != ENOMEM)	/* Unexpected failure mode.  */
+ 	    {
+ 	      result = errno;
+ 	      goto out;

Added: trunk/glibc/glibc-2.12.2-localedef_trampoline-1.patch
===================================================================
--- trunk/glibc/glibc-2.12.2-localedef_trampoline-1.patch	                        (rev 0)
+++ trunk/glibc/glibc-2.12.2-localedef_trampoline-1.patch	2011-08-14 04:08:25 UTC (rev 2308)
@@ -0,0 +1 @@
+link glibc-2.5-localedef_trampoline-1.patch
\ No newline at end of file


Property changes on: trunk/glibc/glibc-2.12.2-localedef_trampoline-1.patch
___________________________________________________________________
Added: svn:special
   + *

Added: trunk/glibc/glibc-2.12.2-pt_pax-1.patch
===================================================================
--- trunk/glibc/glibc-2.12.2-pt_pax-1.patch	                        (rev 0)
+++ trunk/glibc/glibc-2.12.2-pt_pax-1.patch	2011-08-14 04:08:25 UTC (rev 2308)
@@ -0,0 +1 @@
+link glibc-2.3.5-pt_pax-1.patch
\ No newline at end of file


Property changes on: trunk/glibc/glibc-2.12.2-pt_pax-1.patch
___________________________________________________________________
Added: svn:special
   + *




More information about the patches mailing list