summaryrefslogtreecommitdiffstats
path: root/compiler-rt/include/sanitizer
Commit message (Collapse)AuthorAgeFilesLines
...
* [sanitizer-coverage] nuke more stale codeKostya Serebryany2017-06-021-2/+0
| | | | llvm-svn: 304504
* [sanitizer-coverage] nuke more stale codeKostya Serebryany2017-06-011-4/+0
| | | | llvm-svn: 304500
* [sanitizer-coverage] remove stale code (old coverage); compiler-rt part Kostya Serebryany2017-05-311-3/+0
| | | | llvm-svn: 304318
* [tsan] Detect races on modifying accesses in Swift codeKuba Mracek2017-05-031-0/+1
| | | | | | | | This patch allows the Swift compiler to emit calls to `__tsan_external_write` before starting any modifying access, which will cause TSan to detect races on arrays, dictionaries and other classes defined in non-instrumented modules. Races on collections from the Swift standard library and user-defined structs and a frequent cause of subtle bugs and it's important that TSan detects those on top of existing LLVM IR instrumentation, which already detects races in direct memory accesses. Differential Revision: https://reviews.llvm.org/D31630 llvm-svn: 302050
* tsan: support linker init flag in __tsan_mutex_destroyDmitry Vyukov2017-05-011-1/+2
| | | | | | | | | | | | | | For a linker init mutex with lazy flag setup (no __tsan_mutex_create call), it is possible that no lock/unlock happened before the destroy call. Then when destroy runs we still don't know that it is a linker init mutex and will emulate a memory write. This in turn can lead to false positives as the mutex is in fact linker initialized. Support linker init flag in destroy annotation to resolve this. llvm-svn: 301795
* [tsan] Publish the TSan external API in tsan_interface.hKuba Mracek2017-04-211-0/+15
| | | | | | | | | | | | | Let's make the TSan external API available and commented in the public header: void *__tsan_external_register_tag(const char *object_type); void __tsan_external_assign_tag(void *addr, void *tag); void __tsan_external_read(void *addr, void *caller_pc, void *tag); void __tsan_external_write(void *addr, void *caller_pc, void *tag); Differential Revision: https://reviews.llvm.org/D32358 llvm-svn: 301003
* [sanitizer-coverage] remove more unused codeKostya Serebryany2017-04-191-8/+0
| | | | llvm-svn: 300780
* [sanitizer-coverage] remove run-time support for ↵Kostya Serebryany2017-04-191-2/+0
| | | | | | -fsanitize-coverage=indirect-calls llvm-svn: 300775
* [sanitizer-coverage] remove run-time support for the deprecated ↵Kostya Serebryany2017-04-191-19/+0
| | | | | | -fsanitize-coverage=8bit-counters llvm-svn: 300745
* tsan: add new mutex annotationsDmitry Vyukov2017-03-261-0/+121
| | | | | | | | | | | | | | There are several problems with the current annotations (AnnotateRWLockCreate and friends): - they don't fully support deadlock detection (we need a hook _before_ mutex lock) - they don't support insertion of random artificial delays to perturb execution (again we need a hook _before_ mutex lock) - they don't support setting extended mutex attributes like read/write reentrancy (only "linker init" was bolted on) - they don't support setting mutex attributes if a mutex don't have a "constructor" (e.g. static, Java, Go mutexes) - they don't ignore synchronization inside of lock/unlock operations which leads to slowdown and false negatives The new annotations solve of the above problems. See tsan_interface.h for the interface specification and comments. Reviewed in https://reviews.llvm.org/D31093 llvm-svn: 298809
* [asan] add one more argument to __sanitizer_print_memory_profile, remove a ↵Kostya Serebryany2017-03-151-1/+3
| | | | | | redundant weak definition. llvm-svn: 297914
* [sancov] __sanitizer_dump_coverage apiMike Aizatsky2016-12-121-0/+5
| | | | | | | | Subscribers: kubabrecka, mgorny Differential Revision: https://reviews.llvm.org/D26758 llvm-svn: 289498
* [sanitizers] __sanitizer_get_module_and_offset_for_pc interface functionMike Aizatsky2016-12-051-0/+7
| | | | | | | | | | | | Summary: The function computes full module name and coverts pc into offset. Reviewers: kcc Subscribers: kubabrecka Differential Revision: https://reviews.llvm.org/D26820 llvm-svn: 288711
* [sanitizer-coverage] remove stale code, second attempt after failed r282994Kostya Serebryany2016-10-041-8/+0
| | | | llvm-svn: 283185
* [ASAN] Pass previous stack information through __sanitizer_finish_switch_fiberDmitry Vyukov2016-09-281-1/+3
| | | | | | | | | | | This patch extends __sanitizer_finish_switch_fiber method to optionally return previous stack base and size. This solves the problem of coroutines/fibers library not knowing the original stack context from which the library is used. It's incorrect to assume that such context is always the default stack of current thread (e.g. one such library may be used from a fiber/coroutine created by another library). Bulding a separate stack tracking mechanism would not only duplicate AsanThread, but also require each coroutines/fibers library to integrate with it. Author: Andrii Grynenko (andriigrynenko) Reviewed in: https://reviews.llvm.org/D24628 llvm-svn: 282582
* [sanitizer] rename __sanitizer_symbolize_data to ↵Kostya Serebryany2016-09-191-2/+2
| | | | | | __sanitizer_symbolize_global (to avoid conflict with another definition) llvm-svn: 281902
* [sanitizer] add __sanitizer_symbolize_data (can only print the names of the ↵Kostya Serebryany2016-09-191-0/+3
| | | | | | globals for now) llvm-svn: 281886
* [sanitizer] add __sanitizer_symbolize_pc. ↵Kostya Serebryany2016-08-251-0/+7
| | | | | | https://github.com/google/sanitizers/issues/322 llvm-svn: 279780
* [sanitizers] trace buffer API to use user-allocated buffer.Mike Aizatsky2016-08-051-7/+9
| | | | | | | | Subscribers: kubabrecka Differential Revision: https://reviews.llvm.org/D23186 llvm-svn: 277858
* [esan|wset] Fix flaky sampling testsDerek Bruening2016-07-191-0/+4
| | | | | | | Adds a new esan public interface routine __esan_get_sample_count() and uses it to ensure that tests of sampling receive the minimum number of samples. llvm-svn: 275948
* [sanitizers] add interceptor for memmem; add weak hooks for strncasecmp, ↵Kostya Serebryany2016-07-151-0/+11
| | | | | | strcasecmp, strstr, strcasestr, memmem llvm-svn: 275621
* [esan] Add __esan_report for mid-run dataDerek Bruening2016-07-091-0/+46
| | | | | | | | | | | | | | | | | | | | | Summary: Adds a new public interface routine __esan_report() which can be used to request profiling results prior to abnormal termination (e.g., for a server process killed by its parent where the normal exit does not allow for normal result reporting). Implements this for the working-set tool. The cache frag tool is left unimplemented as it requires missing iteration capabilities. Adds a new test. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D22098 llvm-svn: 274964
* [sanitizer] Add syscall handlers for sigaction and rt_sigaction.Evgeniy Stepanov2016-06-241-5/+18
| | | | llvm-svn: 273746
* [asan] add primitives that allow coroutine implementationsDmitry Vyukov2016-06-211-0/+20
| | | | | | | | | | | | | | | | | This patch adds the __sanitizer_start_switch_fiber and __sanitizer_finish_switch_fiber methods inspired from what can be found here https://github.com/facebook/folly/commit/2ea64dd24946cbc9f3f4ac3f6c6b98a486c56e73 . These methods are needed when the compiled software needs to implement coroutines, fibers or the like. Without a way to annotate them, when the program jumps to a stack that is not the thread stack, __asan_handle_no_return shows a warning about that, and the fake stack mechanism may free fake frames that are still in use. Author: blastrock (Philippe Daouadi) Reviewed in http://reviews.llvm.org/D20913 llvm-svn: 273260
* [sanitizers] introduce yet another API function: ↵Kostya Serebryany2016-06-161-0/+17
| | | | | | __sanitizer_install_malloc_and_free_hooks llvm-svn: 272943
* [asan] fix arm buildKostya Serebryany2016-06-021-1/+1
| | | | llvm-svn: 271474
* [asan] add an interface function __sanitizer_print_memory_profile (a basic ↵Kostya Serebryany2016-06-021-0/+6
| | | | | | memory profiler; asan/Linux-only for now) llvm-svn: 271463
* [sanitizers] introduce __sanitizer_set_report_fd so that we can re-route the ↵Kostya Serebryany2016-05-271-0/+3
| | | | | | sanitizer logging to another fd from inside the process llvm-svn: 271046
* [libFuzzer] extend the weak memcmp/strcmp/strncmp interceptors to receive ↵Kostya Serebryany2016-01-121-2/+4
| | | | | | the result of the computations. With that, don't do any mutations if memcmp/etc returned 0 llvm-svn: 257423
* [sancov] coverage pc bufferMike Aizatsky2016-01-051-0/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D15871 llvm-svn: 256804
* Asan: utility function to determine first wrongly poisoned byte inMike Aizatsky2015-11-041-0/+6
| | | | | | | | container. Differential Revision: http://reviews.llvm.org/D14341 llvm-svn: 252071
* [sanitizer-coverage] introduce __sanitizer_get_total_unique_caller_callee_pairsKostya Serebryany2015-10-221-1/+3
| | | | llvm-svn: 251071
* [msan] Add __msan_copy_shadow interface function.Evgeniy Stepanov2015-10-121-0/+6
| | | | | | This can be used to annotate copies of memory that are not observed by MSan. llvm-svn: 250124
* [MSan] Deprecate __msan_set_death_callback() in favor of ↵Alexey Samsonov2015-08-211-2/+1
| | | | | | __sanitizer_set_death_callback(). llvm-svn: 245754
* [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across ↵Alexey Samsonov2015-08-213-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | all sanitizers. Summary: Merge "exitcode" flag from ASan, LSan, TSan and "exit_code" from MSan into one entity. Additionally, make sure sanitizer_common now uses the value of common_flags()->exitcode when dying on error, so that this flag will automatically work for other sanitizers (UBSan and DFSan) as well. User-visible changes: * "exit_code" MSan runtime flag is now deprecated. If explicitly specified, this flag will take precedence over "exitcode". The users are encouraged to migrate to the new version. * __asan_set_error_exit_code() and __msan_set_exit_code() functions are removed. With few exceptions, we don't support changing runtime flags during program execution - we can't make them thread-safe. The users should use __sanitizer_set_death_callback() that would call _exit() with proper exit code instead. * Plugin tools (LSan and UBSan) now inherit the exit code of the parent tool. In particular, this means that ASan would now crash the program with exit code "1" instead of "23" if it detects leaks. Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12120 llvm-svn: 245734
* [sanitizer] add a weak hook for strncmp interceptor, both to dfsan and other ↵Kostya Serebryany2015-07-302-2/+6
| | | | | | sanitizers. Hide the declaration and the calls in better macros llvm-svn: 243610
* [sanitizer] add a weak hook for memcmp interceptor, to be used primarily for ↵Kostya Serebryany2015-07-301-0/+9
| | | | | | fuzzing. More hooks will be added later. So far this is a Linux-only feature llvm-svn: 243601
* re-added changes due to svn config setting issuesNaomi Musgrave2015-07-171-0/+3
| | | | llvm-svn: 242589
* Add dfsan_weak_hook_memcmpKostya Serebryany2015-05-071-0/+10
| | | | | | | | | | | | | | | | | | | 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
* [lsan] Add an interface function for on-demand leak checking.Sergey Matveev2015-04-241-6/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: Add an interface function which can be used to periodically trigger leak detection in a long-running process. NB: The meaning of the kIgnored tag has been changed to allow easy clean-up between subsequent leak checks. Previously, this tag was applied to explicitly ignored (i.e. with __lsan_disable() or __lsan_ignore_object()) chunks *and* any chunks only reachable from those. With this change, it's only applied to explicitly ignored chunks. Reviewers: samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9159 llvm-svn: 235728
* Revert r235726 "interface"Sergey Matveev2015-04-241-17/+6
| | | | | | Accidentally committed from local branch. :( llvm-svn: 235727
* interfaceSergey Matveev2015-04-241-6/+17
| | | | llvm-svn: 235726
* [sanitizer/coverage] Add AFL-style coverage counters (search heuristic for ↵Kostya Serebryany2015-03-031-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | fuzzing). Introduce -mllvm -sanitizer-coverage-8bit-counters=1 which adds imprecise thread-unfriendly 8-bit coverage counters. The run-time library maps these 8-bit counters to 8-bit bitsets in the same way AFL (http://lcamtuf.coredump.cx/afl/technical_details.txt) does: counter values are divided into 8 ranges and based on the counter value one of the bits in the bitset is set. The AFL ranges are used here: 1, 2, 3, 4-7, 8-15, 16-31, 32-127, 128+. These counters provide a search heuristic for single-threaded coverage-guided fuzzers, we do not expect them to be useful for other purposes. Depending on the value of -fsanitize-coverage=[123] flag, these counters will be added to the function entry blocks (=1), every basic block (=2), or every edge (=3). Use these counters as an optional search heuristic in the Fuzzer library. Add a test where this heuristic is critical. llvm-svn: 231166
* [msan] Fix MsanTest to pass in track_origins=2 mode.Evgeniy Stepanov2015-02-261-0/+5
| | | | llvm-svn: 230639
* [sanitizer] move the coverage interface into a separate header, ↵Kostya Serebryany2015-02-032-20/+46
| | | | | | <sanitizer/coverage_interface.h>. NFC, except for the header name change. This may break existing users, but in this case it's better this way (not too many users so far) llvm-svn: 228017
* [sanitizer] allow to reset the bb/edge coverage data inside the process ↵Kostya Serebryany2015-01-281-0/+8
| | | | | | while it is running (single-threaded). Also expose the current coverage set to the process. llvm-svn: 227387
* [msan] Refactor shadow operations.Evgeniy Stepanov2015-01-211-1/+3
| | | | | | | Move a bunch of functions to a new source file and rename some of them for consistency. No functional changes. llvm-svn: 226673
* [asan] introduce __sanitizer_set_death_callback, deprecate ↵Kostya Serebryany2014-12-152-2/+4
| | | | | | __asan_set_death_callback llvm-svn: 224286
* [DFSan] Add flag to dump the labels when the program terminates.Lorenzo Martignoni2014-11-201-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D6306 llvm-svn: 222425
* [asan] add interface function __sanitizer_get_total_unique_coverage; useful ↵Kostya Serebryany2014-11-141-0/+3
| | | | | | for coverage-guided in-process fuzzers llvm-svn: 222060
OpenPOWER on IntegriCloud