Author: robert
Date: 2006-10-11 02:04:25 -0600 (Wed, 11 Oct 2006)
New Revision: 1694

Added:
   trunk/glibc/glibc-2.5-dl_execstack_PaX-1.patch
Modified:
   trunk/glibc/glibc-2.3.6-dl_execstack_PaX-1.patch
Log:
Added glibc-2.5-dl_execstack_PaX-1.patch

Modified: trunk/glibc/glibc-2.3.6-dl_execstack_PaX-1.patch
===================================================================
--- trunk/glibc/glibc-2.3.6-dl_execstack_PaX-1.patch    2006-10-11 05:56:03 UTC 
(rev 1693)
+++ trunk/glibc/glibc-2.3.6-dl_execstack_PaX-1.patch    2006-10-11 08:04:25 UTC 
(rev 1694)
@@ -1,7 +1,7 @@
 Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
 Date: 2004-11-13
 Initial Package Version: 2.3.6
-Upstream Status: Rejected Upstream
+Upstream Status: Submitted - 
http://sources.redhat.com/bugzilla/show_bug.cgi?id=3332
 Origin: http://csociety-ftp.ecn.purdue.edu/pub/gentoo-portage/ \
         sys-libs/glibc/files/2.3.3/glibc-2.3.3-dl_execstack-PaX-support.patch
 Description: This is needed for Pax. http://pax.grsecurity.net/

Added: trunk/glibc/glibc-2.5-dl_execstack_PaX-1.patch
===================================================================
--- trunk/glibc/glibc-2.5-dl_execstack_PaX-1.patch                              
(rev 0)
+++ trunk/glibc/glibc-2.5-dl_execstack_PaX-1.patch      2006-10-11 08:04:25 UTC 
(rev 1694)
@@ -0,0 +1,69 @@
+Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
+Date: 2004-11-13
+Initial Package Version: 2.3.6
+Upstream Status: Submitted - 
http://sources.redhat.com/bugzilla/show_bug.cgi?id=3332
+Origin: http://csociety-ftp.ecn.purdue.edu/pub/gentoo-portage/ \
+        sys-libs/glibc/files/2.3.3/glibc-2.3.3-dl_execstack-PaX-support.patch
+Description: This is needed for Pax. http://pax.grsecurity.net/
+
+Also see:
+http://www.linuxfromscratch.org/hlfs/
+
+diff -Naur glibc-2.3.6.orig/sysdeps/unix/sysv/linux/dl-execstack.c 
glibc-2.3.6/sysdeps/unix/sysv/linux/dl-execstack.c
+--- glibc-2.3.6.orig/sysdeps/unix/sysv/linux/dl-execstack.c    2005-07-18 
04:11:19.000000000 +0000
++++ glibc-2.3.6/sysdeps/unix/sysv/linux/dl-execstack.c 2005-11-13 
08:50:35.000000000 +0000
+@@ -58,14 +58,20 @@
+                                       __stack_prot) == 0, 1))
+       goto return_success;
+ # if __ASSUME_PROT_GROWSUPDOWN == 0
+-      if (errno == EINVAL)
++      if (errno == EINVAL) {
+       no_growsupdown = true;
+-      else
++      } else {
+ # endif
++      if (errno == EACCES)            /* PAX is enabled */
++      return 0;
++      else
+       {
+         result = errno;
+         goto out;
+       }
++# if __ASSUME_PROT_GROWSUPDOWN == 0
++      }
++# endif
+     }
+ #endif
+ 
+@@ -89,11 +95,14 @@
+       page -= size;
+       else
+       {
+-        if (errno != ENOMEM)  /* Unexpected failure mode.  */
++        if (errno == EACCES) {        /* PAX is enabled  */
++          return 0;
++        } else if (errno != ENOMEM) { /* Unexpected failure mode.  */
+           {
+             result = errno;
+             goto out;
+           }
++        }
+ 
+         if (size == GLRO(dl_pagesize))
+           /* We just tried to mprotect the top hole page and failed.
+@@ -115,11 +124,14 @@
+       page += size;
+       else
+       {
+-        if (errno != ENOMEM)  /* Unexpected failure mode.  */
++        if (errno == EACCES) {        /* PAX is enabled */
++          return 0;
++        } else if (errno != ENOMEM)  /* Unexpected failure mode.  */
+           {
+             result = errno;
+             goto out;
+           }
++        }
+ 
+         if (size == GLRO(dl_pagesize))
+           /* We just tried to mprotect the lowest hole page and failed.

-- 
http://linuxfromscratch.org/mailman/listinfo/patches
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to