]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
Add Forward Control-Flow Integrity.
authorTom Roeder <tmroeder@google.com>
Tue, 11 Nov 2014 21:08:02 +0000 (21:08 +0000)
committerTom Roeder <tmroeder@google.com>
Tue, 11 Nov 2014 21:08:02 +0000 (21:08 +0000)
commit63dea2c95275ffcb3ff916946c6961f65aec7dae
tree168e725f5d2bca80c72788aad0a454866dd67383
parent6d093fd78af3ce8b0d6abf533c4d83e2767c6c6a
Add Forward Control-Flow Integrity.

This commit adds a new pass that can inject checks before indirect calls to
make sure that these calls target known locations. It supports three types of
checks and, at compile time, it can take the name of a custom function to call
when an indirect call check fails. The default failure function ignores the
error and continues.

This pass incidentally moves the function JumpInstrTables::transformType from
private to public and makes it static (with a new argument that specifies the
table type to use); this is so that the CFI code can transform function types
at call sites to determine which jump-instruction table to use for the check at
that site.

Also, this removes support for jumptables in ARM, pending further performance
analysis and discussion.

Review: http://reviews.llvm.org/D4167

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221708 91177308-0d34-0410-b5e6-96231b3b80d8
29 files changed:
include/llvm/Analysis/JumpInstrTableInfo.h
include/llvm/CodeGen/CommandFlags.h
include/llvm/CodeGen/ForwardControlFlowIntegrity.h [new file with mode: 0644]
include/llvm/CodeGen/JumpInstrTables.h
include/llvm/CodeGen/Passes.h
include/llvm/InitializePasses.h
include/llvm/Target/TargetInstrInfo.h
include/llvm/Target/TargetOptions.h
lib/Analysis/JumpInstrTableInfo.cpp
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/CMakeLists.txt
lib/CodeGen/ForwardControlFlowIntegrity.cpp [new file with mode: 0644]
lib/CodeGen/JumpInstrTables.cpp
lib/CodeGen/LLVMTargetMachine.cpp
lib/CodeGen/TargetOptionsImpl.cpp
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMBaseInstrInfo.h
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
test/CodeGen/ARM/jump_tables.ll [deleted file]
test/CodeGen/X86/cfi_enforcing.ll [new file with mode: 0644]
test/CodeGen/X86/cfi_invoke.ll [new file with mode: 0644]
test/CodeGen/X86/cfi_non_default_function.ll [new file with mode: 0644]
test/CodeGen/X86/cfi_simple_indirect_call.ll [new file with mode: 0644]
test/CodeGen/X86/jump_table_alias.ll
test/CodeGen/X86/jump_table_align.ll [new file with mode: 0644]
test/CodeGen/X86/jump_table_bitcast.ll
test/CodeGen/X86/jump_tables.ll
test/LTO/jump-table-type.ll