From 9bfd03d723a9cf17673f40513a7adde1d503bcbc Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 11 Nov 2009 19:36:01 -0500 Subject: [PATCH] asm unexecutable stack make stack not executable in assembled files FIXES 125491 Change-Id: I396680b6877843201f6c07d5607385044abd5e74 Reviewed-on: http://gerrit.openafs.org/818 Reviewed-by: Simon Wilkinson Reviewed-by: Russ Allbery Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/lwp/process.amd64.s | 4 ++++ src/lwp/process.i386.s | 3 +++ src/lwp/process.s | 4 ++++ src/lwp/process.s390.s | 6 +++++- src/lwp/process.s390x.s | 6 +++++- src/sys/syscall.s | 4 ++++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/lwp/process.amd64.s b/src/lwp/process.amd64.s index 4b1ef9643..1d59cd4dd 100644 --- a/src/lwp/process.amd64.s +++ b/src/lwp/process.amd64.s @@ -47,6 +47,10 @@ #include +#if defined(__linux__) && defined(__ELF__) + .section .note.GNU-stack,"",%progbits +#endif + .file "process.s" .data .text diff --git a/src/lwp/process.i386.s b/src/lwp/process.i386.s index 9e7ddb3a0..f5b3bc416 100644 --- a/src/lwp/process.i386.s +++ b/src/lwp/process.i386.s @@ -17,6 +17,9 @@ */ #include +#if defined(__linux__) && defined(__ELF__) + .section .note.GNU-stack,"",%progbits +#endif .file "process.s" diff --git a/src/lwp/process.s b/src/lwp/process.s index cbc0c9b89..4f81456b1 100644 --- a/src/lwp/process.s +++ b/src/lwp/process.s @@ -10,6 +10,10 @@ #define IGNORE_STDS_H 1 #include +#if defined(__linux__) && defined(__ELF__) + .section .note.GNU-stack,"",%progbits +#endif + #if defined(__arm32__) || defined(__arm__) /* register definitions */ fp .req r11 diff --git a/src/lwp/process.s390.s b/src/lwp/process.s390.s index 660ec1f4a..585404fdd 100644 --- a/src/lwp/process.s390.s +++ b/src/lwp/process.s390.s @@ -16,7 +16,11 @@ #define IGNORE_STDS_H 1 #include - .file "process.s" +#if defined(__linux__) && defined(__ELF__) + .section .note.GNU-stack,"",%progbits +#endif + + .file "process.s" .globl savecontext .type savecontext,%function diff --git a/src/lwp/process.s390x.s b/src/lwp/process.s390x.s index e36b7cab0..f3087bfcf 100644 --- a/src/lwp/process.s390x.s +++ b/src/lwp/process.s390x.s @@ -17,7 +17,11 @@ #define IGNORE_STDS_H 1 #include - .file "process.s" +#if defined(__linux__) && defined(__ELF__) + .section .note.GNU-stack,"",%progbits +#endif + + .file "process.s" .globl savecontext .type savecontext,%function diff --git a/src/sys/syscall.s b/src/sys/syscall.s index 233117fa1..c42d5780f 100644 --- a/src/sys/syscall.s +++ b/src/sys/syscall.s @@ -10,6 +10,10 @@ #define IGNORE_STDS_H #include +#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; -- 2.39.5