]> granicus.if.org Git - clang/commit
[CFI] Add CFI-icall pointer type generalization
authorVlad Tsyrklevich <vlad@tsyrklevich.net>
Tue, 31 Oct 2017 22:39:44 +0000 (22:39 +0000)
committerVlad Tsyrklevich <vlad@tsyrklevich.net>
Tue, 31 Oct 2017 22:39:44 +0000 (22:39 +0000)
commit746fd88cc65883572b7602dc7b1f9e74462fd451
tree0df935811a2170ba214956d0d703276504999c5f
parenta934273b7cd28c48745e4c5a122ca3a505ab2028
[CFI] Add CFI-icall pointer type generalization

Summary:
This change allows generalizing pointers in type signatures used for
cfi-icall by enabling the -fsanitize-cfi-icall-generalize-pointers flag.
This works by 1) emitting an additional generalized type signature
metadata node for functions and 2) llvm.type.test()ing for the
generalized type for translation units with the flag specified.

This flag is incompatible with -fsanitize-cfi-cross-dso because it would
require emitting twice as many type hashes which would increase artifact
size.

Reviewers: pcc, eugenis

Reviewed By: pcc

Subscribers: kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317044 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
docs/ClangCommandLineReference.rst
docs/ControlFlowIntegrity.rst
docs/UsersManual.rst
include/clang/Driver/Options.td
include/clang/Driver/SanitizerArgs.h
include/clang/Frontend/CodeGenOptions.def
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
lib/Driver/SanitizerArgs.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/cfi-icall-cross-dso.c
test/CodeGen/cfi-icall-generalize.c [new file with mode: 0644]
test/CodeGen/cfi-icall.c
test/CodeGenCXX/cfi-icall.cpp
test/Driver/fsanitize.c