Protection against stack-based memory corruption errors using SafeStack: Clang...
Protection against stack-based memory corruption errors using SafeStack: Clang command line option and function attribute This patch adds the -fsanitize=safe-stack command line argument for clang, which enables the Safe Stack protection (see 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 Clang. The patches make the following changes: - Add -fsanitize=safe-stack and -fno-sanitize=safe-stack options to clang to control safe stack usage (the safe stack is disabled by default). - Add __attribute__((no_sanitize("safe-stack"))) attribute to clang that can be used to disable the safe stack for individual functions even when enabled globally. Original patch by Volodymyr Kuznetsov and others at the Dependable Systems Lab at EPFL; updates and upstreaming by myself. Differential Revision: http://reviews.llvm.org/D6095 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239762 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- docs/LanguageExtensions.rst 3 additions, 0 deletionsdocs/LanguageExtensions.rst
- docs/SafeStack.rst 163 additions, 0 deletionsdocs/SafeStack.rst
- docs/UsersManual.rst 2 additions, 0 deletionsdocs/UsersManual.rst
- docs/index.rst 1 addition, 0 deletionsdocs/index.rst
- include/clang/Basic/Builtins.def 4 additions, 0 deletionsinclude/clang/Basic/Builtins.def
- include/clang/Basic/Sanitizers.def 3 additions, 0 deletionsinclude/clang/Basic/Sanitizers.def
- include/clang/Driver/SanitizerArgs.h 3 additions, 0 deletionsinclude/clang/Driver/SanitizerArgs.h
- lib/CodeGen/CGDeclCXX.cpp 2 additions, 0 deletionslib/CodeGen/CGDeclCXX.cpp
- lib/CodeGen/CodeGenFunction.cpp 2 additions, 0 deletionslib/CodeGen/CodeGenFunction.cpp
- lib/Driver/Tools.cpp 17 additions, 1 deletionlib/Driver/Tools.cpp
- lib/Lex/PPMacroExpansion.cpp 1 addition, 0 deletionslib/Lex/PPMacroExpansion.cpp
- test/CodeGen/safestack-attr.cpp 6 additions, 0 deletionstest/CodeGen/safestack-attr.cpp
- test/CodeGen/stack-protector.c 4 additions, 0 deletionstest/CodeGen/stack-protector.c
- test/Driver/fsanitize.c 12 additions, 0 deletionstest/Driver/fsanitize.c
Loading
Please register or sign in to comment