summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/cfi/cross-dso
Commit message (Collapse)AuthorAgeFilesLines
* [cfi][test] cross-dso/stats.cpp: don't assume the order of static constructorsFangrui Song2020-01-081-4/+4
| | | | | | | | __sanitizer_stat_init is called for the executable first, then the shared object. In WriterModuleReport(), the information for the shared object will be recorded first. It'd be nice to get rid of the order requirement of static constructors. (This should make .ctors platforms work.)
* [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.*Reid Kleckner2019-06-272-0/+0
| | | | | | | | | | | | | These lit configuration files are really Python source code. Using the .py file extension helps editors and tools use the correct language mode. LLVM and Clang already use this convention for lit configuration, this change simply applies it to all of compiler-rt. Reviewers: vitalybuka, dberris Differential Revision: https://reviews.llvm.org/D63658 llvm-svn: 364591
* [Cfi] Compiling cfi library on FreeBSD and NetBSDDavid Carlier2018-10-011-1/+1
| | | | | | | | | | | | Making the library slighty more portable. Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D51682 llvm-svn: 343510
* [cfi] Use __builtin version of __clear_cache.Evgeniy Stepanov2018-06-291-1/+1
| | | | | | __builtin___clear_cache is also present on X86 and does the right thing (i.e. nop) there. llvm-svn: 335997
* [cfi] Reset i-cache after copying code in test.Evgeniy Stepanov2018-06-291-2/+4
| | | | | | | Fixes intermittent crashes on Android. Also add PROT_READ to the code mapping for no real reason. llvm-svn: 335943
* [cfi] Test cross-dso CFI on Android.Evgeniy Stepanov2017-10-164-1/+41
| | | | | | | | | | Reviewers: vitalybuka, pcc Subscribers: llvm-commits, srhines Differential Revision: https://reviews.llvm.org/D38911 llvm-svn: 315922
* [cfi] Use %ld_flags_rpath_* substitutions in tests (NFC)Evgeniy Stepanov2017-10-135-70/+70
| | | | llvm-svn: 315775
* [sanitizer] Test ubsan and cfi on android.Evgeniy Stepanov2017-10-061-1/+1
| | | | | | | | | | | | | | | Summary: Enable check-cfi and check-ubsan on Android. Check-ubsan includes standalone and ubsan+asan, but not tsan or msan. Cross-dso cfi tests are disabled for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38608 llvm-svn: 315105
* [cfi] Enable icall tests with thinlto.Evgeniy Stepanov2017-06-162-4/+0
| | | | llvm-svn: 305534
* [cfi] Run tests with and without lld and thinlto.Evgeniy Stepanov2017-04-212-0/+7
| | | | | | | Run tests in all configurations: (standalone, with devirtualization) * (gold, lld) * (lto, thinlto) llvm-svn: 301016
* [cfi] Move one test under cross-dso/icall.Evgeniy Stepanov2017-04-201-1/+1
| | | | | | The test is using indirect calls. llvm-svn: 300900
* [cfi] Tweak a test for the cfi-icall change.Evgeniy Stepanov2016-11-111-4/+4
| | | | llvm-svn: 286612
* [cfi] Safe handling of unaddressable vtable pointers (compiler-rt).Evgeniy Stepanov2016-02-031-13/+45
| | | | | | | | | | | Avoid crashing when printing diagnostics for vtable-related CFI errors. In diagnostic mode, the frontend does an additional check of the vtable pointer against the set of all known vtable addresses and lets the runtime handler know if it is safe to inspect the vtable. http://reviews.llvm.org/D16824 llvm-svn: 259717
* [cfi] Get rid of a fixed size buffer for the library path in test.Evgeniy Stepanov2016-01-281-3/+4
| | | | llvm-svn: 259082
* [cfi] Fix recovery from out-of-bounds vtable error.Evgeniy Stepanov2016-01-281-3/+7
| | | | llvm-svn: 259007
* [cfi] Fix a warning in tests.Evgeniy Stepanov2016-01-271-1/+1
| | | | | | | test/cfi/cross-dso/dlopen.cpp:67:45: warning: GCC does not allow 'aligned' attribute in this position on a function definition [-Wgcc-compat] extern "C" void do_nothing() __attribute__((aligned(4096))) {} llvm-svn: 258992
* [cfi] Disable vtable diagnostics when no cxxabi.Evgeniy Stepanov2016-01-271-0/+2
| | | | | | This should fix the build on Mac 10.8 and earlier. llvm-svn: 258988
* [cfi] Better handling of wild target address.Evgeniy Stepanov2016-01-261-0/+28
| | | | | | | | | | | | | This change enables diagnostics when the target address for a CFI check is out of bounds of any known library, or even not in the limits of the address space. This happens when casting pointers to uninitialized memory. Ubsan code does not yet handle some of these situations correctly, so it is still possible to see a segmentation fault instead of a proper diagnostic message once in a while. llvm-svn: 258879
* [cfi] Hide runtime implementation in a namespace.Evgeniy Stepanov2016-01-261-1/+4
| | | | | | | | Move all internal stuff into namespace __cfi. Remove the double underscore prefix from anything that's now inside the namespace. llvm-svn: 258859
* [cfi] Support for dlopen and dlclose.Evgeniy Stepanov2016-01-262-0/+228
| | | | | | Add dlopen/dlclose interceptors to update CFI shadow for loaded/unloaded libraries. llvm-svn: 258857
* [cfi] Cross-DSO CFI diagnostic mode (compiler-rt part)Evgeniy Stepanov2016-01-254-0/+182
| | | | | | | | | | | | | | | * 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
* Introduce stats and stats_client libraries.Peter Collingbourne2016-01-161-0/+59
| | | | | | | | | This is part of a new statistics gathering feature for the sanitizers. See clang/docs/SanitizerStats.rst for further info and docs. Differential Revision: http://reviews.llvm.org/D16176 llvm-svn: 257972
* [cfi] Fix handling of uninstrumented libraries.Evgeniy Stepanov2015-12-221-0/+5
| | | | | | CFI shadow for non-CFI libraries should be "unchecked", not "invalid". llvm-svn: 256285
* [cfi] Limit cross-dso tests to Linux.Evgeniy Stepanov2015-12-161-0/+9
| | | | | | Mac is missing the driver support to link the CFI runtime library. llvm-svn: 255730
* Cross-DSO control flow integrity (compiler-rt part).Evgeniy Stepanov2015-12-155-0/+202
This is an initial version of the runtime cross-DSO CFI support library. It contains a number of FIXMEs, ex. it does not support the diagnostic mode nor dlopen/dlclose, but it works and can be tested. Diagnostic mode, in particular, would require some refactoring (we'd like to gather all CFI hooks in the UBSan library into one function so that we could easier pass the diagnostic information down to __cfi_check). It will be implemented later. Once the diagnostic mode is in, I plan to create a second test configuration to run all existing tests in both modes. For now, this patch includes only a few new cross-DSO tests. llvm-svn: 255695
OpenPOWER on IntegriCloud