5059ab35f3
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@1552 6952d904-891a-0410-993b-d76249ca496b
51 lines
1.4 KiB
Diff
51 lines
1.4 KiB
Diff
diff -Nru glibc-2.3.3.old/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2.3.3/sysdeps/unix/sysv/linux/dl-execstack.c
|
|
--- glibc-2.3.3.old/sysdeps/unix/sysv/linux/dl-execstack.c 2004-09-24 01:40:02.663710000 -0400
|
|
+++ glibc-2.3.3/sysdeps/unix/sysv/linux/dl-execstack.c 2004-09-24 01:54:55.883919888 -0400
|
|
@@ -56,11 +56,17 @@
|
|
__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
|
|
+ return errno;
|
|
+# if __ASSUME_PROT_GROWSUPDOWN == 0
|
|
+ }
|
|
# endif
|
|
- return errno;
|
|
}
|
|
#endif
|
|
|
|
@@ -84,8 +90,11 @@
|
|
page -= size;
|
|
else
|
|
{
|
|
- if (errno != ENOMEM) /* Unexpected failure mode. */
|
|
+ if (errno == EACCES) { /* PAX is enabled */
|
|
+ return 0;
|
|
+ } else if (errno != ENOMEM) { /* Unexpected failure mode. */
|
|
return errno;
|
|
+ }
|
|
|
|
if (size == GLRO(dl_pagesize))
|
|
/* We just tried to mprotect the top hole page and failed.
|
|
@@ -107,8 +116,11 @@
|
|
page += size;
|
|
else
|
|
{
|
|
- if (errno != ENOMEM) /* Unexpected failure mode. */
|
|
+ if (errno == EACCES) { /* PAX is enabled */
|
|
+ return 0;
|
|
+ } else if (errno != ENOMEM) { /* Unexpected failure mode. */
|
|
return errno;
|
|
+ }
|
|
|
|
if (size == GLRO(dl_pagesize))
|
|
/* We just tried to mprotect the lowest hole page and failed.
|