]> granicus.if.org Git - clang/commit
Protection against stack-based memory corruption errors using SafeStack: Clang comman...
authorPeter Collingbourne <peter@pcc.me.uk>
Mon, 15 Jun 2015 21:08:13 +0000 (21:08 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Mon, 15 Jun 2015 21:08:13 +0000 (21:08 +0000)
commit4d2986d891c61a8913620289f9f901da1b3e5084
tree0d2c8d9b79bec7cea8528e2e487ec9afcd779f36
parent134252ae55d59c031f99fd62dcc2f7e7db88b342
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
14 files changed:
docs/LanguageExtensions.rst
docs/SafeStack.rst [new file with mode: 0644]
docs/UsersManual.rst
docs/index.rst
include/clang/Basic/Builtins.def
include/clang/Basic/Sanitizers.def
include/clang/Driver/SanitizerArgs.h
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/Driver/Tools.cpp
lib/Lex/PPMacroExpansion.cpp
test/CodeGen/safestack-attr.cpp [new file with mode: 0644]
test/CodeGen/stack-protector.c
test/Driver/fsanitize.c