summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/dfsan
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sanitizers] Allow to install several internal Die callbacks.Alexey Samsonov2015-08-241-1/+1
| | | | | | | | | | | | | | | | | This is required to properly re-apply r245770: 1) We should be able to dump coverage in __sanitizer::Die() if coverage collection is turned on. 2) We don't want to explicitly do this in every single sanitizer that supports it. 3) We don't want to link in coverage (and therefore symbolization) bits into small sanitizers that don't support it (safestack). The solution is to make InitializeCoverage() register its own Die() callback that would call __sanitizer_cov_dump(). This callback should be executed in addition to another tool-specific die callbacks (if there are any). llvm-svn: 245889
* [dfsan] Enable DFSan for AArch64/42-bit VMAAdhemerval Zanella2015-08-242-0/+28
| | | | | | | | | This patch adds support for dfsan on aarch64-linux with 42-bit VMA (current default config for 64K pagesize kernels). The support is enabled by defining the SANITIZER_AARCH64_VMA to 42 at build time for both clang/llvm and compiler-rt. The default VMA is 39 bits. llvm-svn: 245841
* [DFSan] Remove nolibc build.Alexey Samsonov2015-08-212-11/+1
| | | | | | It's not used now, as is not even included in "dfsan" target. llvm-svn: 245766
* [DFSan] Properly initialize and parse common flags in DFSan.Alexey Samsonov2015-08-181-1/+7
| | | | llvm-svn: 245362
* [libFuzzer] add weak hooks for strcmpKostya Serebryany2015-08-051-0/+6
| | | | llvm-svn: 244083
* [libFuzzer/DFSan] add more __sanitizer callbacks to dfsan blacklistKostya Serebryany2015-08-051-0/+20
| | | | llvm-svn: 244082
* [libFuzzer] prepare for __sanitizer_cov_trace_switch in libFuzzer and ↵Kostya Serebryany2015-07-312-2/+5
| | | | | | sanitizer coverage. Also fix pedantic warnings llvm-svn: 243721
* [dfsan] Enable dfsan for aarch64Adhemerval Zanella2015-07-302-0/+23
| | | | | | | | | | | | | This patch enable DFSan for AArch64 (39-bit VMA). All tests are passing but: * test/dfsan/custom.cc Due an invalid access in dl_iterate_phdr instrumentation (commenting out this function make the testcase to pass). The test is XFAIL for aarch64 for now. llvm-svn: 243688
* [sanitizer] add a weak hook for strncmp interceptor, both to dfsan and other ↵Kostya Serebryany2015-07-301-8/+22
| | | | | | sanitizers. Hide the declaration and the calls in better macros llvm-svn: 243610
* [dfsan/libFuzzer] correctly ignore sanitizer coverage calls in dfsanKostya Serebryany2015-07-281-2/+10
| | | | llvm-svn: 243362
* [sanitizer] Implement logging to syslog.Evgeniy Stepanov2015-07-231-0/+1
| | | | | | | | | | | | | | | | | Previously, Android target had a logic of duplicating all sanitizer output to logcat. This change extends it to all posix platforms via the use of syslog, controlled by log_to_syslog flag. Enabled by default on Android, off everywhere else. A bit of cmake magic is required to allow Printf() to call a libc function. I'm adding a stub implementation to support no-libc builds like dfsan and safestack. This is a second attempt. I believe I've fixed all the issues that prompted the revert: Mac build, and all kinds of non-CMake builds (there are 3 of those). llvm-svn: 243051
* Revert r242975.Evgeniy Stepanov2015-07-231-1/+0
| | | | | | Breaks Mac build. llvm-svn: 242978
* [sanitizer] Implement logging to syslog.Evgeniy Stepanov2015-07-221-0/+1
| | | | | | | | | | | | | Previously, Android target had a logic of duplicating all sanitizer output to logcat. This change extends it to all posix platforms via the use of syslog, controlled by log_to_syslog flag. Enabled by default on Android, off everywhere else. A bit of cmake magic is required to allow Printf() to call a libc function. I'm adding a stub implementation to support no-libc builds like dfsan and safestack. llvm-svn: 242975
* [dfsan] ignore more __sanitizer callbacksKostya Serebryany2015-05-231-5/+3
| | | | llvm-svn: 238085
* Add dfsan_weak_hook_memcmpKostya Serebryany2015-05-071-0/+9
| | | | | | | | | | | | | | | | | | | Summary: Add a weak hook to be called from dfsan's custom memcmp. The primary user will be lib/Fuzzer. If this works well we'll add more hooks (strcmp, etc). Test Plan: Will be covered by lib/Fuzzer tests. Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9541 llvm-svn: 236679
* Add api_list entries for the dfsan-based fuzzerKostya Serebryany2015-05-062-1/+20
| | | | | | | | | | | | | | | | Summary: Add api_list entries for the dfsan-based fuzzer Test Plan: covered by check-fuzzer Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9538 llvm-svn: 236657
* Make check_custom_wrappers.sh work on FreeBSDDimitry Andric2015-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When running the compiler-rt testsuite on FreeBSD (it didn't matter which version), I always got the same error result: FAILED: cd /home/dim/obj/llvm-234092-trunk-freebsd10-amd64-ninja-rel-1/projects/compiler-rt/lib && LLVM_CHECKOUT=/home/dim/src/llvm/trunk SILENT=1 TMPDIR= PYTHON_EXECUTABLE=/usr/local/bin/python2.7 COMPILER_RT=/home/dim/src/llvm/trunk/projects/compiler-rt /home/dim/src/llvm/trunk/projects/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh The following differences between the implemented custom wrappers and the tests have been found: --- /tmp/tmp.vPFEefvclf 2015-04-04 17:11:44.996734563 +0200 +++ /tmp/tmp.NbIuvjxKEe 2015-04-04 17:11:45.044734647 +0200 @@ -1,52 +0,0 @@ -calloc -clock_gettime -ctime_r -dfsan_set_write_callback -dl_iterate_phdr -dlopen -fgets -fstat -get_current_dir_name -getcwd -gethostname -getpwuid_r -getrlimit -getrusage -gettimeofday -inet_pton -localtime_r -memchr -memcmp -memcpy -memset -nanosleep -poll -pread -pthread_create -read -sched_getaffinity -select -sigaction -sigemptyset -snprintf -socketpair -sprintf -stat -strcasecmp -strchr -strcmp -strcpy -strdup -strlen -strncasecmp -strncmp -strncpy -strrchr -strstr -strtod -strtol -strtoll -strtoul -strtoull -time -write After some investigation, it turns out to be due to the regex used for search test_ symbols in lib/dfsan/scripts/check_customer_wrappers.sh: grep -E "^\\s*test_.*\(\);" ${DFSAN_CUSTOM_TESTS} This uses \s to search for whitespace at start of line, but support for \s was only introduced in GNU grep v2.5.4-112-gf979ca0, while both FreeBSD and OSX only have grep 2.5.1 (the last version released under GPLv2). I propose to change \s into [[:space:]], which is the more portable notation. Test Plan: Run regression tests, and see that they work now. :) Reviewers: pcc, samsonov, emaste Reviewed By: emaste Subscribers: llvm-commits, emaste Differential Revision: http://reviews.llvm.org/D8832 llvm-svn: 234704
* Extend s{,n}printf custom wrappers to support '*' in the format specifiersLorenzo Martignoni2015-04-101-210/+191
| | | | | | Differential Revision: http://reviews.llvm.org/D8966 llvm-svn: 234633
* Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portableTimur Iskhodzhanov2015-04-101-1/+1
| | | | | | | On Windows, we have to know if a memory to be protected is mapped or not. On POSIX, Mprotect was semantically different from mprotect most people know. llvm-svn: 234602
* Revert r234477, "Differential Revision: http://reviews.llvm.org/D7249"Peter Collingbourne2015-04-093-203/+214
| | | | | | Should unbreak fuzzer buildbot. llvm-svn: 234542
* Use WriteToFile instead of internal_write in non-POSIX codeTimur Iskhodzhanov2015-04-091-4/+4
| | | | llvm-svn: 234487
* Introduce CloseFile to be used instead of internal_close on non-POSIXTimur Iskhodzhanov2015-04-091-1/+1
| | | | llvm-svn: 234481
* Differential Revision: http://reviews.llvm.org/D7249Lorenzo Martignoni2015-04-093-214/+203
| | | | llvm-svn: 234477
* [libsanitizer] Fix OpenFile() usage in TSan and DFSan.Alexander Potapenko2015-03-231-1/+1
| | | | | | This is a follow-up for r232936. llvm-svn: 232937
* Remove support for building sanitizers from Makefile/autoconf build on Linux.Alexey Samsonov2015-02-181-23/+0
| | | | | | | This is a re-application of r229554 restricted to Linux build only. Apple still uses Makefile/autoconf to build Clang and sanitizers. llvm-svn: 229756
* Revert "Remove support for building sanitizers from Makefile/autoconf build."Matthias Braun2015-02-171-0/+23
| | | | | | | | | This reverts commit r229556. Reverting this for now as internal apple builds rely on this functionality. llvm-svn: 229585
* Remove support for building sanitizers from Makefile/autoconf build.Alexey Samsonov2015-02-171-23/+0
| | | | | | | | They autotools build has a number of missing features, supports less OS, architectures, build configurations, doesn't have any tests and is hard to support in sync with CMake build. llvm-svn: 229556
* [Sanitizer] Change InitializeFlags() signatures. NFC.Alexey Samsonov2015-02-121-7/+6
| | | | | | | These functions are always used to initialize singleton flags(), as well as other global data (common_flags()). llvm-svn: 228894
* [Sanitizers] Introduce GET_LINK_MAP_BY_DLOPEN_HANDLE() macroViktor Kutuzov2015-01-301-2/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D7233 llvm-svn: 227570
* [dfsan] Use append_no_rtti_flag instead of manually specifying -fno-rtti.Evgeniy Stepanov2015-01-191-1/+2
| | | | llvm-svn: 226435
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-153-6/+8
| | | | | | | The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. llvm-svn: 226169
* [dfsan] Export dfsan_get_label_info function with C linkage.Peter Collingbourne2015-01-121-1/+1
| | | | llvm-svn: 225692
* [Sanitizer] Change the runtime flag representation.Alexey Samsonov2015-01-073-20/+53
| | | | | | | | | | | This mirrors r225239 to all the rest sanitizers: ASan, DFSan, LSan, MSan, TSan, UBSan. Now the runtime flag type, name, default value and description is located in the single place in the .inc file. llvm-svn: 225327
* [DFSAN][MIPS] adding support of DFSAN for MIPS64Peter Collingbourne2014-12-053-3/+31
| | | | | | | | | | Minor changes to enable DFSAN on MIPS64 Patch by Kumar Sukhani! Differential Revision: http://reviews.llvm.org/D6437 llvm-svn: 223517
* [DFSan] Add flag to dump the labels when the program terminates.Lorenzo Martignoni2014-11-202-2/+55
| | | | | | Differential Revision: http://reviews.llvm.org/D6306 llvm-svn: 222425
* Fix -Wcast-qual warnings in sanitizersAlexey Samsonov2014-11-131-10/+14
| | | | llvm-svn: 221936
* [dfsan] Add runtime function for aborting on indirect calls toPeter Collingbourne2014-11-051-0/+9
| | | | | | uninstrumented vararg functions. llvm-svn: 221364
* [dfsan] Add libgo functions to ABI list.Peter Collingbourne2014-11-051-0/+21
| | | | llvm-svn: 221363
* [dfsan] Upgrade ABI list to Ubuntu 14.04.Peter Collingbourne2014-11-052-298/+46
| | | | | | This incorporates some of the newer functions used by (e.g.) the Go runtime. llvm-svn: 221362
* [dfsan] Modify build-libc-list.py to filter out local functions in generatedPeter Collingbourne2014-11-051-0/+1
| | | | | | ABI list. llvm-svn: 221361
* Update __dfsw_s{,n}printf custom functions for new calling convention.Peter Collingbourne2014-10-301-20/+17
| | | | | | Differential Revision: http://reviews.llvm.org/D6029 llvm-svn: 220907
* [compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, ↵Kuba Brecka2014-10-151-2/+2
| | | | | | | | | | let's rename it to append_list_if Doing s/append_if/append_list_if/, no functional change. http://reviews.llvm.org/D5739 llvm-svn: 219860
* Remove bashisms and switch to /bin/shEd Maste2014-10-081-16/+16
| | | | | | | | | On a default FreeBSD install Bash is not installed and fdescfs is not mounted. Use plain sh functionality instead. Differential Revision: http://reviews.llvm.org/D5631 llvm-svn: 219333
* Custom wrappers for DFSanitizing sprintf & snprintf.Lorenzo Martignoni2014-10-083-3/+286
| | | | | | Differential Revision: http://reviews.llvm.org/D5561 llvm-svn: 219293
* DFSan's set label function should avoid writing to the shadow memory when ↵Peter Collingbourne2014-08-191-1/+13
| | | | | | | | | | | | | | the write would not change the value in memory. When writing a label to shadow memory, don't write if the value is already set to the value being written. This dramatically reduces real memory consumption in programs with sparse use of labels. Test Plan: It would be nice to test that unnecessary writes are skipped, but I do not see how a unit test could do this. Patch by Sam Kerner! Differential Revision: http://reviews.llvm.org/D4894 llvm-svn: 215961
* [DFSan] Fixup for r213980Alexey Samsonov2014-07-261-1/+1
| | | | llvm-svn: 213997
* [Sanitizer] Introduce SANITIZER_CAN_USE_PREINIT_ARRAY definition and use it ↵Alexey Samsonov2014-07-251-1/+1
| | | | | | | | | | across sanitizers. Get rid of ASAN_USE_PREINIT_ARRAY and LSAN_USE_PREINIT_ARRAY - just always use .preinit_array if it's available. This mode seems stable enough, and we've been relying on default values of these macro for a long time. llvm-svn: 213980
* [dfsan] Fix the declaration of dfsan_add_label.Peter Collingbourne2014-06-041-0/+1
| | | | llvm-svn: 210202
* The newest versions of CMake require outputs of custom commands be inChandler Carruth2014-04-301-1/+1
| | | | | | | | DEPENDS rather than SOURCES. The SOURCES just end up looking on the filesystem and not finding anything. Makes for very hard to debug build errors. =/ llvm-svn: 207722
* Add user-defined callback on write() calls.Peter Collingbourne2014-04-242-1/+45
| | | | | | | | | | | Add dfsan_set_write_callback(), which sets a callback to be invoked when a write() call is invoked within DFSan instrumented code. Patch by Sam Kerner! Differential Revision: http://reviews.llvm.org/D3268 llvm-svn: 207131
OpenPOWER on IntegriCloud