Implement diagnostic mode for -fsanitize=cfi*, -fsanitize=cfi-diag.
This causes programs compiled with this flag to print a diagnostic when a control flow integrity check fails instead of aborting. Diagnostics are printed using UBSan's runtime library. The main motivation of this feature over -fsanitize=vptr is fidelity with the -fsanitize=cfi implementation: the diagnostics are printed under exactly the same conditions as those which would cause -fsanitize=cfi to abort the program. This means that the same restrictions apply regarding compiling all translation units with -fsanitize=cfi, cross-DSO virtual calls are forbidden, etc. Differential Revision: http://reviews.llvm.org/D10268 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240109 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- docs/UsersManual.rst 6 additions, 4 deletionsdocs/UsersManual.rst
- lib/CodeGen/CGCXXABI.h 2 additions, 1 deletionlib/CodeGen/CGCXXABI.h
- lib/CodeGen/CGClass.cpp 39 additions, 17 deletionslib/CodeGen/CGClass.cpp
- lib/CodeGen/CGExpr.cpp 4 additions, 2 deletionslib/CodeGen/CGExpr.cpp
- lib/CodeGen/CGExprCXX.cpp 3 additions, 2 deletionslib/CodeGen/CGExprCXX.cpp
- lib/CodeGen/CGExprScalar.cpp 6 additions, 2 deletionslib/CodeGen/CGExprScalar.cpp
- lib/CodeGen/CodeGenFunction.h 13 additions, 3 deletionslib/CodeGen/CodeGenFunction.h
- lib/CodeGen/ItaniumCXXABI.cpp 8 additions, 4 deletionslib/CodeGen/ItaniumCXXABI.cpp
- lib/CodeGen/MicrosoftCXXABI.cpp 6 additions, 4 deletionslib/CodeGen/MicrosoftCXXABI.cpp
- lib/Driver/SanitizerArgs.cpp 6 additions, 2 deletionslib/Driver/SanitizerArgs.cpp
- test/CodeGenCXX/cfi-cast.cpp 9 additions, 9 deletionstest/CodeGenCXX/cfi-cast.cpp
- test/CodeGenCXX/cfi-vcall.cpp 16 additions, 5 deletionstest/CodeGenCXX/cfi-vcall.cpp
Loading
Please register or sign in to comment