[PATCH] Protection against stack-based memory corruption errors using SafeStack: Clang command line option and function attribute

Volodymyr Kuznetsov vova.kuznetsov at epfl.ch
Mon Nov 3 09:42:07 PST 2014


Hi theraven,

This patch adds the -fsafe-stack command line argument for clang, which enables the Safe Stack protection (see [[ http://reviews.llvm.org/D6094 | http://reviews.llvm.org/D6094 ]] for the detailed description of the Safe Stack).

This patch is our implementation of the safe stack on top of the current SVN HEAD of Clang (r221154). The patches make the following changes:

-- Add -fsafe-stack and -fno-safe-stack options to clang to control safe stack usage (the safe stack is disabled by default).
-- Add __attribute__((no_safe_stack)) attribute to clang that can be used to disable the safe stack for individual functions even when enabled globally.

http://reviews.llvm.org/D6095

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/AttrDocs.td
  include/clang/Basic/LangOptions.def
  include/clang/Basic/LangOptions.h
  include/clang/Driver/Options.td
  lib/CodeGen/CodeGenModule.cpp
  lib/Driver/ToolChains.cpp
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/InitPreprocessor.cpp
  lib/Sema/SemaDeclAttr.cpp
  runtime/compiler-rt/Makefile
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6095.15718.patch
Type: text/x-patch
Size: 12258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141103/d1ff420b/attachment.bin>


More information about the cfe-commits mailing list