summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2015-01-28[sanitizer] allow to reset the bb/edge coverage data inside the process ↵Kostya Serebryany
while it is running (single-threaded). Also expose the current coverage set to the process. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-21[msan] Refactor shadow operations.Evgeniy Stepanov
Move a bunch of functions to a new source file and rename some of them for consistency. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226673 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15[asan] introduce __sanitizer_set_death_callback, deprecate ↵Kostya Serebryany
__asan_set_death_callback git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224286 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-20[DFSan] Add flag to dump the labels when the program terminates.Lorenzo Martignoni
Differential Revision: http://reviews.llvm.org/D6306 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222425 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14[asan] add interface function __sanitizer_get_total_unique_coverage; useful ↵Kostya Serebryany
for coverage-guided in-process fuzzers git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222060 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13Fix minor typos in comments.Filipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219632 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26[compiler-rt] recommit of r218481: ASan debugging API for report info ↵Kuba Brecka
extraction and locating addresses Reviewed at http://reviews.llvm.org/D4527 Fixed a test case failure on 32-bit Linux, I did right shift on intptr_t, instead it should have been uintptr_t. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218538 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26[compiler-rt] revert r218481 due to test failure on sanitizer-x86_64-linux Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218501 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-25[compiler-rt] ASan debugging API for report info extraction and locating ↵Kuba Brecka
addresses Reviewed at http://reviews.llvm.org/D4527 This patch is part of an effort to implement a more generic debugging API, as proposed in http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-July/074656.html, with first part reviewed at http://reviews.llvm.org/D4466. Now adding several new APIs: __asan_report_present, __asan_get_report_{pc,bp,sp,address,type,size,description}, __asan_locate_address. These return whether an asan report happened yet, the PC, BP, SP, address, access type (read/write), access size and bug description (e.g. "heap-use-after-free"), __asan_locate_address takes a pointer and tries to locate it, i.e. say whether it is a heap pointer, a global or a stack, or whether it's a pointer into the shadow memory. If global or stack, tries to also return the variable name, address and size. If heap, tries to return the chunk address and size. Generally these should serve as an alternative to "asan_describe_address", which only returns all the data in text form. Having an API to get these data could allow having debugging scripts/extensions that could show additional information about a variable/expression/pointer. Test cases in test/asan/TestCases/debug_locate.cc and test/asan/TestCasea/debug_report.cc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218481 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12[Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in ↵Alexey Samsonov
favor of a unified interface in <sanitizer/allocator_interface.h>. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15[ASan] Add ASan debugging API to get malloc/free stack traces and shadow ↵Kuba Brecka
memory mapping info Reviewed at http://reviews.llvm.org/D4466 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213080 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-07Generalize sanitizer allocator public interface.Alexey Samsonov
Introduce new public header <sanitizer/allocator_interface.h> and a set of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc. that will eventually replace their tool-specific equivalents (__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific functions are now deprecated and implemented as stubs redirecting to __sanitizer_ versions (which are implemented differently in each tool). Replace all uses of __xsan_ versions with __sanitizer_ versions in unit and lit tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21[sanitizer] Add __sanitizer_maybe_open_cov_file().Sergey Matveev
Summary: Add a new interface function required for coverage sandboxing support. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209298 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21[msan] Chained origins re-design.Evgeniy Stepanov
Generalize StackDepot and create a new specialized instance of it to efficiently (i.e. without duplicating stack trace data) store the origin history tree. This reduces memory usage for chained origins roughly by an order of magnitude. Most importantly, this new design allows us to put two limits on stored history data (exposed in MSAN_OPTIONS) that help avoid exponential growth in used memory on certain workloads. See comments in lib/msan/msan_origin.h for more details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209284 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-19[sanitizer] Support sandboxing in sanitizer coverage.Sergey Matveev
Summary: Sandboxed code may now pass additional arguments to __sanitizer_sandbox_on_notify() to force all coverage data to be dumped to a single file (the default is one file per module). The user may supply a file or socket to write to. The latter option can be used to broker out the file writing functionality. If -1 is passed, we pre-open a file. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209121 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-06[asan] introduce interface function __sanitizer_verify_contiguous_container ↵Kostya Serebryany
to verify annotations in vector-like containers git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208092 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30[asan] make AsanCoverage lock-free (and AS-safe)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207630 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30[msan] Prettify __msan_print_shadow.Evgeniy Stepanov
Makes __msan_print_shadow output much more readable, adds origin info. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207622 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24Add user-defined callback on write() calls.Peter Collingbourne
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207131 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14[asan] don't use bool in public interface, make sure the interface headers ↵Kostya Serebryany
are usable in plain C git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@206160 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-02[msan] Kill __msan_print_param_shadow.Evgeniy Stepanov
It does not do what it's name says, and what it actually does is hard to describe, and is not useful at all. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205415 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-02[msan] Add __msan_check_mem_is_initialized.Evgeniy Stepanov
An assert()-like function that checks that a memory range is fully initialized. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205413 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27[msan] Implement __msan_set_death_callback.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204926 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26Add function to get the number of DFSan labels allocated.Peter Collingbourne
Expose the number of DFSan labels allocated by adding function dfsan_get_label_count(). Patch by Sam Kerner! Differential Revision: http://llvm-reviews.chandlerc.com/D3109 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204854 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21[MSan] Add __msan_unpoison_string() to the public interface.Sergey Matveev
Using __msan_unpoison() on null-terminated strings is awkward because strlen() can't be called on a poisoned string. This case warrants a special interface function. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204448 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20[msan] Remove stubs for non-instrumented code from msan interface header.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201777 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Rename several variablesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201575 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-06[asan] introduce two functions that will allow implementations of C++ ↵Kostya Serebryany
garbage colection to work with asan's fake stack git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200908 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15[lsan] remove LeakSanitizerIsTurnedOffForTheCurrentProcess (this was a bad ↵Kostya Serebryany
idea), leave __lsan_is_turned_off git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199304 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15[msan] Fix an incorrect comment.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199300 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13[lsan] Add __lsan_default_suppressions() to the public interface header.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199121 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13[sanitizer] fix commentKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199112 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-10[lsan] rename __lsan_is_turned_off to ↵Kostya Serebryany
LeakSanitizerIsTurnedOffForTheCurrentProcess (leave the old variant for now for compatibility) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-19[ASan] Get rid of __asan_symbolize functionAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-17[lsan] Introduce __lsan_(un)register_root_region().Sergey Matveev
Add an interface for telling LSan that a region of memory is to be treated as a source of live pointers. Useful for code which stores pointers in mapped memory. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197489 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-11[TSan] Move declarations of __tsan_atomic functions to a public headerAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197015 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03[sanitizer] Expose __sanitizer_print_stack_trace().Sergey Matveev
Expose a new interface function for debugging code built with sanitizer tools. Add an ASan implementation. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196302 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19[asan] remove a fixed FIXME; extend the comment around ↵Kostya Serebryany
__sanitizer_annotate_contiguous_container git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195131 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19[asan] new shadow poison magic for contiguous-container-buffer-overflow, ↵Kostya Serebryany
addressed Alexey Samsonov's comments for r195011 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195117 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18[asan] introduce __sanitizer_annotate_contiguous_containerKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195011 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18CMake: make sure compiler-rt headers are copied to build tree if ↵Alexey Samsonov
'compilrer-rt' target is built git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195002 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15Reapply asan coverage changes 194702-194704.Bob Wilson
I still don't know what is causing our bootstrapped LTO buildbots to fail, but llvm r194701 seems to be OK and I can't imagine that these changes could cause the problem. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194790 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15Speculatively revert asan coverage changes 194702-194704.Bob Wilson
Apple's bootstrapped LTO builds have been failing, and these changes (along with llvm 194701) are the only things on the blamelist. I will either reapply these changes or help debug the problem, depending on whether this fixes the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14[asan] unbreak dfsan, which includes sanitizer/common_interface_defs.h into ↵Kostya Serebryany
internal sources (although it shoudn't) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194704 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14[asan] Poor man's coverage that works with ASan (compiler-rt part)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194702 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23tsan: fix linux syscall hooksDmitry Vyukov
the file references non-existent arguments and breaks build git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15tsan: remove __sanitizer_set_report_fd function from public interfaceDmitry Vyukov
__sanitizer_set_report_path now accepts two special values - stderr and stdout logging to other file descriptors is not supported anymore, it's fragile in presence of multiple processes, fork, etc git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192706 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21tsan: intercept fork syscallDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191144 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10[msan] Make all pointers in msan_interface "const volatile void *".Evgeniy Stepanov
This way msan annotations can be used with both normal and volatile memory. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190403 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10[msan] bool -> int to make msan_interface.h C-compatible.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190402 91177308-0d34-0410-b5e6-96231b3b80d8