asm unexecutable stack
authorDerrick Brashear <shadow@dementia.org>
Thu, 12 Nov 2009 00:36:01 +0000 (19:36 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Tue, 17 Nov 2009 00:45:08 +0000 (16:45 -0800)
make stack not executable in assembled files

FIXES 125491

Change-Id: I396680b6877843201f6c07d5607385044abd5e74
Reviewed-on: http://gerrit.openafs.org/818
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/lwp/process.amd64.s
src/lwp/process.i386.s
src/lwp/process.s
src/lwp/process.s390.s
src/lwp/process.s390x.s
src/sys/syscall.s

index 4b1ef96..1d59cd4 100644 (file)
 
 #include <lwp_elf.h>
        
+#if defined(__linux__) && defined(__ELF__)
+       .section .note.GNU-stack,"",%progbits
+#endif
+
        .file "process.s"
        .data
        .text
index 9e7ddb3..f5b3bc4 100644 (file)
@@ -17,6 +17,9 @@
  */
 
 #include <lwp_elf.h>
+#if defined(__linux__) && defined(__ELF__)
+       .section .note.GNU-stack,"",%progbits
+#endif
 
        .file "process.s"
 
index cbc0c9b..4f81456 100644 (file)
 #define        IGNORE_STDS_H   1
 #include <afs/param.h>
 
+#if defined(__linux__) && defined(__ELF__)
+       .section .note.GNU-stack,"",%progbits
+#endif
+
 #if defined(__arm32__) || defined(__arm__)
        /* register definitions */
        fp      .req    r11
index 660ec1f..585404f 100644 (file)
 #define        IGNORE_STDS_H   1
 #include <afs/param.h>
 
-              .file   "process.s"
+#if defined(__linux__) && defined(__ELF__)
+        .section .note.GNU-stack,"",%progbits
+#endif
+
+       .file   "process.s"
 
               .globl savecontext
               .type  savecontext,%function
index e36b7ca..f3087bf 100644 (file)
 #define IGNORE_STDS_H  1
 #include <afs/param.h>
 
-              .file   "process.s"
+#if defined(__linux__) && defined(__ELF__)
+        .section .note.GNU-stack,"",%progbits
+#endif
+
+       .file   "process.s"
 
               .globl savecontext
               .type  savecontext,%function
index 233117f..c42d578 100644 (file)
 #define        IGNORE_STDS_H
 #include <afs/param.h>
 
+#if defined(__linux__) && defined(__ELF__)
+       .section .note.GNU-stack,"",%progbits
+#endif
+
 #if defined(AFS_AIX32_ENV) && defined(RIOS)
        /*
         * This is never be referenced, and is only here as placeholder;