[PATCH] D41567: Add NO_EXEC_STACK_DIRECTIVE to chkstk and chkstk2 sources

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 24 11:53:32 PST 2017


dim created this revision.
dim added reviewers: compnerd, rnk.
Herald added subscribers: Sanitizers, javed.absar.

As reported in bug 35739, the arch-specific sources for the chkstk and
chkstk2 functions do not contain NO_EXEC_STACK_DIRECTIVE macros, and
therefore have an executable stack by default.  This can cause warnings
from automated vulnerability scanners.

Add the directives to make these warnings go away.  This is basically a
follow-up to https://reviews.llvm.org/rL273500.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D41567

Files:
  lib/builtins/aarch64/chkstk.S
  lib/builtins/i386/chkstk.S
  lib/builtins/i386/chkstk2.S
  lib/builtins/x86_64/chkstk.S
  lib/builtins/x86_64/chkstk2.S


Index: lib/builtins/x86_64/chkstk2.S
===================================================================
--- lib/builtins/x86_64/chkstk2.S
+++ lib/builtins/x86_64/chkstk2.S
@@ -40,3 +40,6 @@
 END_COMPILERRT_FUNCTION(__alloca)
 
 #endif // __x86_64__
+
+NO_EXEC_STACK_DIRECTIVE
+
Index: lib/builtins/x86_64/chkstk.S
===================================================================
--- lib/builtins/x86_64/chkstk.S
+++ lib/builtins/x86_64/chkstk.S
@@ -37,3 +37,6 @@
 END_COMPILERRT_FUNCTION(___chkstk_ms)
 
 #endif // __x86_64__
+
+NO_EXEC_STACK_DIRECTIVE
+
Index: lib/builtins/i386/chkstk2.S
===================================================================
--- lib/builtins/i386/chkstk2.S
+++ lib/builtins/i386/chkstk2.S
@@ -38,3 +38,6 @@
 END_COMPILERRT_FUNCTION(_alloca)
 
 #endif // __i386__
+
+NO_EXEC_STACK_DIRECTIVE
+
Index: lib/builtins/i386/chkstk.S
===================================================================
--- lib/builtins/i386/chkstk.S
+++ lib/builtins/i386/chkstk.S
@@ -32,3 +32,6 @@
 END_COMPILERRT_FUNCTION(__chkstk_ms)
 
 #endif // __i386__
+
+NO_EXEC_STACK_DIRECTIVE
+
Index: lib/builtins/aarch64/chkstk.S
===================================================================
--- lib/builtins/aarch64/chkstk.S
+++ lib/builtins/aarch64/chkstk.S
@@ -32,3 +32,6 @@
 END_COMPILERRT_FUNCTION(__chkstk)
 
 #endif // __aarch64__
+
+NO_EXEC_STACK_DIRECTIVE
+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41567.128115.patch
Type: text/x-patch
Size: 1380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171224/0e08725c/attachment.bin>


More information about the llvm-commits mailing list