]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix ia64 executable stack default (bug 22156).
authorJoseph Myers <joseph@codesourcery.com>
Tue, 26 Sep 2017 16:30:46 +0000 (16:30 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 26 Sep 2017 16:30:46 +0000 (16:30 +0000)
As per https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01220.html ia64
defaults to non-executable stacks in the Linux kernel (furthermore,
the use of function descriptors means that trampolines for nested
function pointers never need an executable stack).  glibc however
defines DEFAULT_STACK_PERMS to include PF_X for that architecture,
meaning (a) elf/check-execstack fails and (b) (from code inspection,
not tested, but this is why I think this is a user-visible bug) thread
stacks are unnecessarily mapped with execute permission.  This patch
fixes the DEFAULT_STACK_PERMS definition in question.

Tested (compilation only) with build-many-glibcs.py for ia64.  This
fixes the check-execstack failure.

[BZ #22156]
* sysdeps/ia64/stackinfo.h (DEFAULT_STACK_PERMS): Likewise.

ChangeLog
sysdeps/ia64/stackinfo.h

index 41d3ed48eeb31deb16b7129ced2b0808550e6cc4..f8435ad1fad1eb0b02c3e0e809fdf7c1072077d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-26  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #22156]
+       * sysdeps/ia64/stackinfo.h (DEFAULT_STACK_PERMS): Likewise.
+
 2017-09-26  Florian Weimer  <fweimer@redhat.com>
 
        * resolv/Makefile (tests-internal): Fix typo in comment.
index 87e144876f3ba81538c8ffba8eff53518d5c094a..a50e72749a87dd8336e10ff00c291adbcbce556b 100644 (file)
@@ -27,8 +27,7 @@
    here.  */
 #define _STACK_GROWS_DOWN      1
 
-/* Default to an executable stack.  PF_X can be overridden if PT_GNU_STACK is
- * present, but it is presumed absent.  */
-#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
+/* Default to a non-executable stack.  */
+#define DEFAULT_STACK_PERMS (PF_R|PF_W)
 
 #endif /* stackinfo.h */