Commit Graph

8 Commits

Author SHA1 Message Date
Evgeniy Stepanov 3a8ad7e2f6 Cross-DSO control flow integrity (Clang part).
Clang-side cross-DSO CFI.

* Adds a command line flag -f[no-]sanitize-cfi-cross-dso.
* Links a runtime library when enabled.
* Emits __cfi_slowpath calls is bitset test fails.
* Emits extra hash-based bitsets for external CFI checks.
* Sets a module flag to enable __cfi_check generation during LTO.

This mode does not yet support diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255694 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 23:00:20 +00:00
Peter Collingbourne 2f3ff4374a docs: Add design documentation for forward-edge CFI for indirect calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254464 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 21:58:54 +00:00
Peter Collingbourne f29b6351df CFI: Introduce -fsanitize=cfi-icall flag.
This flag causes the compiler to emit bit set entries for functions as well
as runtime bitset checks at indirect call sites. Depends on the new function
bitset mechanism.

Differential Revision: http://reviews.llvm.org/D11857

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 02:17:40 +00:00
Peter Collingbourne a92eeaef0b docs: Document byte arrays.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-12 00:30:41 +00:00
Peter Collingbourne 42799650cb docs: Document CFI padding and all-ones optimizations. Link to viewvc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230588 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 00:18:04 +00:00
Peter Collingbourne 48900547fd docs: Document optimizations in control flow integrity design doc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230458 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25 03:35:03 +00:00
Peter Collingbourne 8bf3730592 CFI: Improve design doc with larger virtual tables and asm examples.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 20:22:17 +00:00
Peter Collingbourne f9d64b33eb Implement Control Flow Integrity for virtual calls.
This patch introduces the -fsanitize=cfi-vptr flag, which enables a control
flow integrity scheme that checks that virtual calls take place using a vptr of
the correct dynamic type. More details in the new docs/ControlFlowIntegrity.rst
file.

It also introduces the -fsanitize=cfi flag, which is currently a synonym for
-fsanitize=cfi-vptr, but will eventually cover all CFI checks implemented
in Clang.

Differential Revision: http://reviews.llvm.org/D7424

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230055 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 20:30:56 +00:00