summaryrefslogtreecommitdiff
path: root/include/sanitizer/msan_interface.h
AgeCommit message (Collapse)Author
2018-07-06[MSan] Add functions to enable/disable interceptor checks.Matt Morehouse
Summary: The motivation for this change is to make libFuzzer+MSan possible without instrumenting libFuzzer. See https://github.com/google/sanitizers/issues/958. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D48890 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-21[sanitizer] Make function declarations C-compatiblePetr Hosek
The public sanitizer headers are intended to be usable from either C++ or C, but they declare no-argument functions with the syntax that is not a proper prototype declaration in C. This goes unnoticed until someone uses -Wsystem-headers. Patch By: mcgrathr Reviewers: phosek, vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D41475 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321305 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-12[msan] Add __msan_copy_shadow interface function.Evgeniy Stepanov
This can be used to annotate copies of memory that are not observed by MSan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250124 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21[MSan] Deprecate __msan_set_death_callback() in favor of ↵Alexey Samsonov
__sanitizer_set_death_callback(). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245754 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21[Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across ↵Alexey Samsonov
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245734 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17re-added changes due to svn config setting issuesNaomi Musgrave
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@242589 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26[msan] Fix MsanTest to pass in track_origins=2 mode.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230639 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-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-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[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-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-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-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-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
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
2013-08-02[msan] Allocator statistics interface and malloc hooks.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187653 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21[msan] Add keep_going runtime flag.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184542 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-23[MSan] Make a few interface functions accept 'const void *' instead of 'void*'Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@180102 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30[sanitizer] Further split private and public sanitizer headers.Evgeniy Stepanov
And make msan_interface.h C-compatible. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30[msan] Remove an extra #ifdef.Evgeniy Stepanov
__has_feature is always defined at this point. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173920 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29[msan] Cleanup public interface header.Evgeniy Stepanov
Moved everything users are not supposed to use to a private interface header. Documented all public interfaces. Made them safe to use even if built without MemorySanitizer. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173800 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28[msan] A runtime call to support custom allocators.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11[msan] Add a missing file from r169858.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@169860 91177308-0d34-0410-b5e6-96231b3b80d8