You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
2.7 KiB
85 lines
2.7 KiB
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
# |
|
# Filename: package/.../paxctl/patches/glibc-2.5-dl_execstack_PaX-1.patch |
|
# Copyright (C) 2008 The OpenSDE Project |
|
# |
|
# More information can be found in the files COPYING and README. |
|
# |
|
# This patch file is dual-licensed. It is available under the license the |
|
# patched project is licensed under, as long as it is an OpenSource license |
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms |
|
# of the GNU General Public License as published by the Free Software |
|
# Foundation; either version 2 of the License, or (at your option) any later |
|
# version. |
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
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.
|
|
|