Implement Control Flow Integrity for virtual calls.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 20 Feb 2015 20:30:56 +0000 (20:30 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 20 Feb 2015 20:30:56 +0000 (20:30 +0000)
commita4ccff32818c05c9f2d7a2a6503866d13636b664
treed0853e78880e850956141ea043fecb36250e5842
parente6909c8e8ba07acb5e6366186fe186c91054e93c
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

llvm-svn: 230055
20 files changed:
clang/docs/ControlFlowIntegrity.rst [new file with mode: 0644]
clang/docs/ControlFlowIntegrityDesign.rst [new file with mode: 0644]
clang/docs/UsersManual.rst
clang/docs/index.rst
clang/include/clang/AST/Mangle.h
clang/include/clang/Basic/Sanitizers.def
clang/include/clang/Driver/Driver.h
clang/include/clang/Driver/SanitizerArgs.h
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/CodeGen/CGClass.cpp
clang/lib/CodeGen/CGVTables.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/CodeGen/CodeGenModule.h
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/lib/Driver/Driver.cpp
clang/lib/Driver/SanitizerArgs.cpp
clang/lib/Driver/Tools.cpp
clang/test/CodeGenCXX/cfi-vptr.cpp [new file with mode: 0644]
clang/test/Driver/fsanitize.c