summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/ubsan/ubsan_handlers_cxx.h
Commit message (Collapse)AuthorAgeFilesLines
* Finish "Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFO"Stephan Bergmann2019-07-161-7/+8
| | | | | | | | | | | | | | | | | | | | | i.e., recent 5745eccef54ddd3caca278d1d292a88b2281528b: * Bump the function_type_mismatch handler version, as its signature has changed. * The function_type_mismatch handler can return successfully now, so SanitizerKind::Function must be AlwaysRecoverable (like for SanitizerKind::Vptr). * But the minimal runtime would still unconditionally treat a call to the function_type_mismatch handler as failure, so disallow -fsanitize=function in combination with -fsanitize-minimal-runtime (like it was already done for -fsanitize=vptr). * Add tests. Differential Revision: https://reviews.llvm.org/D61479 llvm-svn: 366186
* Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFOStephan Bergmann2019-05-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | This follows up after b7692bc3e9ad2691fc07261904b88fb15f30696b "[UBSan] Fix isDerivedFromAtOffset on iOS ARM64" fixed the RTTI comparison in isDerivedFromAtOffset on just one platform and then a25a2c7c9a7e1e328a5bd8274d2d86b1fadc4692 "Always compare C++ typeinfo (based on libstdc++ implementation)" extended that fix to more platforms. But there is another RTTI comparison for -fsanitize=function generated in clang's CodeGenFunction::EmitCall as just a pointer comparison. For SANITIZER_NON_UNIQUE_TYPEINFO platforms this needs to be extended to also do string comparison. For that, __ubsan_handle_function_type_mismatch[_abort] takes the two std::type_info pointers as additional parameters now, checks them internally for potential equivalence, and returns without reporting failure if they turn out to be equivalent after all. (NORETURN needed to be dropped from the _abort variant for that.) Also these functions depend on ABI-specific RTTI now, so needed to be moved from plain UBSAN_SOURCES (ubsan_handlers.h/cc) to UBSAN_CXXABI_SOURCES (ubsan_handlers_cxx.h/cc), but as -fsanitize=function is only supported in C++ mode that's not a problem. Differential Revision: https://reviews.llvm.org/D60760 llvm-svn: 359759
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [cfi] Cross-DSO CFI diagnostic mode (compiler-rt part)Evgeniy Stepanov2016-01-251-14/+0
| | | | | | | | | | | | | | | * add __cfi_slowpath_diag with a 3rd parameter which is a pointer to the diagnostic info for the ubsan handlers. *__cfi_check gets a 3rd parameter as well. * unify vcall/cast/etc and icall diagnostic info format, and merge the handlers to have a single entry point (actually two points due to abort/noabort variants). * tests Note that this comes with a tiny overhead in the non-diag mode: cfi_slowpath must pass 0 as the 3rd argument to cfi_check. llvm-svn: 258744
* Add control flow integrity diagnosis function to UBSan runtime library.Peter Collingbourne2015-06-191-0/+13
| | | | | | | | Also includes execution tests for the feature. Differential Revision: http://reviews.llvm.org/D10269 llvm-svn: 240111
* [ubsan] Move attribute specifier to fix build with gcc.Will Dietz2013-01-101-4/+4
| | | | llvm-svn: 172078
* [ubsan] Give entry methods default (not hidden) visibility.Will Dietz2013-01-101-0/+2
| | | | | | Fixes using ubsan on shared libraries in linux, for example. llvm-svn: 172041
* [ubsan] Refactor handlers to have separate entry points for aborting.Will Dietz2012-12-021-0/+2
| | | | | | | | | If user specifies aborting after a recoverable failed check is appropriate, frontend should emit call to the _abort variant. Test this behavior with newly added -fsanitize-recover flag. llvm-svn: 169113
* -fcatch-undefined-behavior checking for appropriate vptr value: library side.Richard Smith2012-10-251-0/+36
llvm-svn: 166660
OpenPOWER on IntegriCloud