]> granicus.if.org Git - clang/commit
ARM MTE stack sanitizer.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Mon, 15 Jul 2019 20:02:23 +0000 (20:02 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Mon, 15 Jul 2019 20:02:23 +0000 (20:02 +0000)
commit647bdd3207072e2a8417980976636fd57ce9e068
tree01090fd8f3deacf87c74e51958be15dc494c9367
parente4345d25401eb7231e2295a4ee2192d9403fdbb4
ARM MTE stack sanitizer.

Add "memtag" sanitizer that detects and mitigates stack memory issues
using armv8.5 Memory Tagging Extension.

It is similar in principle to HWASan, which is a software implementation
of the same idea, but there are enough differencies to warrant a new
sanitizer type IMHO. It is also expected to have very different
performance properties.

The new sanitizer does not have a runtime library (it may grow one
later, along with a "debugging" mode). Similar to SafeStack and
StackProtector, the instrumentation pass (in a follow up change) will be
inserted in all cases, but will only affect functions marked with the
new sanitize_memtag attribute.

Reviewers: pcc, hctim, vitalybuka, ostannard

Subscribers: srhines, mehdi_amini, javed.absar, kristof.beyls, hiraditya, cryptoad, steven_wu, dexonsmith, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D64169

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366123 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/Basic/Features.def
include/clang/Basic/Sanitizers.def
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/SanitizerMetadata.cpp
lib/Driver/SanitizerArgs.cpp
lib/Driver/ToolChains/Linux.cpp
test/CodeGen/memtag-attr.cpp [new file with mode: 0644]
test/Driver/fsanitize.c
test/Lexer/has_feature_memtag_sanitizer.cpp [new file with mode: 0644]
test/SemaCXX/attr-no-sanitize.cpp