1 Patch by: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
3 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
4 --- glibc-2.3.3.old/sysdeps/unix/sysv/linux/dl-execstack.c 2004-09-24 01:40:02.663710000 -0400
5 +++ glibc-2.3.3/sysdeps/unix/sysv/linux/dl-execstack.c 2004-09-24 01:54:55.883919888 -0400
7 __stack_prot) == 0, 1))
9 # if __ASSUME_PROT_GROWSUPDOWN == 0
10 - if (errno == EINVAL)
11 + if (errno == EINVAL) {
12 no_growsupdown = true;
16 + if (errno == EACCES) /* PAX is enabled */
20 +# if __ASSUME_PROT_GROWSUPDOWN == 0
31 - if (errno != ENOMEM) /* Unexpected failure mode. */
32 + if (errno == EACCES) { /* PAX is enabled */
34 + } else if (errno != ENOMEM) { /* Unexpected failure mode. */
38 if (size == GLRO(dl_pagesize))
39 /* We just tried to mprotect the top hole page and failed.
44 - if (errno != ENOMEM) /* Unexpected failure mode. */
45 + if (errno == EACCES) { /* PAX is enabled */
47 + } else if (errno != ENOMEM) { /* Unexpected failure mode. */
51 if (size == GLRO(dl_pagesize))
52 /* We just tried to mprotect the lowest hole page and failed.