]> git.pld-linux.org Git - packages/glibc.git/blob - glibc-pax_dl-execstack.patch
- gcc 3.4 patch removed.
[packages/glibc.git] / glibc-pax_dl-execstack.patch
1 --- glibc-2.3.3/sysdeps/unix/sysv/linux/dl-execstack.c.orig     2003-12-05 01:26:05.000000000 +0100
2 +++ glibc-2.3.3/sysdeps/unix/sysv/linux/dl-execstack.c  2004-03-18 16:09:49.200234840 +0100
3 @@ -47,11 +47,17 @@
4                       PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) == 0)
5         goto return_success;
6  #  if __ASSUME_PROT_GROWSUPDOWN == 0
7 -      if (errno == EINVAL)
8 +      if (errno == EINVAL) {
9         no_growsdown = true;
10 -      else
11 +      } else {
12 +#  endif
13 +       if (errno == EACCES)            /* PAX is enabled */
14 +         return 0;
15 +       else
16 +         return errno;
17 +#  if __ASSUME_PROT_GROWSUPDOWN == 0
18 +      }
19  #  endif
20 -       return errno;
21      }
22  # endif
23  
24 @@ -73,8 +79,11 @@
25         page -= size;
26        else
27         {
28 -         if (errno != ENOMEM)  /* Unexpected failure mode.  */
29 +         if (errno == EACCES) {        /* PAX is enabled */
30 +           return 0;
31 +         } else if (errno != ENOMEM) { /* Unexpected failure mode.  */
32             return errno;
33 +         }
34  
35           if (size == GL(dl_pagesize))
36             /* We just tried to mprotect the top hole page and failed.
37 @@ -105,11 +114,17 @@
38                       PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSUP) == 0)
39         goto return_success;
40  #  if __ASSUME_PROT_GROWSUPDOWN == 0
41 -      if (errno == EINVAL)
42 +      if (errno == EINVAL) {
43         no_growsup = true;
44 -      else
45 +      } else {
46 +#  endif
47 +       if (errno == EACCES)            /* PAX is enabled */
48 +         return 0;
49 +       else
50 +         return errno;
51 +#  if __ASSUME_PROT_GROWSUPDOWN == 0
52 +      }
53  #  endif
54 -       return errno;
55      }
56  # endif
57  
58 @@ -130,8 +145,11 @@
59         page += size;
60        else
61         {
62 -         if (errno != ENOMEM)  /* Unexpected failure mode.  */
63 +         if (errno == EACCES) {        /* PAX is enabled */
64 +           return 0;
65 +         } else if (errno != ENOMEM) { /* Unexpected failure mode.  */
66             return errno;
67 +         }
68  
69           if (size == GL(dl_pagesize))
70             /* We just tried to mprotect the lowest hole page and failed.
This page took 0.029391 seconds and 3 git commands to generate.