summaryrefslogtreecommitdiff
path: root/lib/msan/msan_interface_internal.h
AgeCommit message (Collapse)Author
2016-09-15[compiler-rt] Do not introduce __sanitizer namespace globallyAnna Zaks
The definitions in sanitizer_common may conflict with definitions from system headers because: The runtime includes the system headers after the project headers (as per LLVM coding guidelines). lib/sanitizer_common/sanitizer_internal_defs.h pollutes the namespace of everything defined after it, which is all/most of the sanitizer .h and .cc files and the included system headers with: using namespace __sanitizer; // NOLINT This patch solves the problem by introducing the namespace only within the sanitizer namespaces as proposed by Dmitry. Differential Revision: https://reviews.llvm.org/D21947 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281657 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[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
2014-11-18[msan] Remove MSanDR and supporting code.Evgeniy Stepanov
MSanDR is a dynamic instrumentation tool that can instrument the code (prebuilt libraries and such) that could not be instrumented at compile time. This code is unused (to the best of our knowledge) and unmaintained, and starting to bit-rot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222232 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-13Fix -Wcast-qual warnings in sanitizersAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221936 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-18[msan] Missing declarations for the new interface functions.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@206586 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-03-18[msan] Origin tracking with history, compiler-rt part.Evgeniy Stepanov
Compiler-rt part of MSan implementation of advanced origin tracking, when we record not only creation point, but all locations where an uninitialized value was stored to memory, too. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204152 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-20[msan] Replace wrap_indirect_calls runtime flag with an interface method.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197799 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13[msan] Add source file:line to stack origin reports.Evgeniy Stepanov
Runtime library part. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190686 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-13Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where ↵Timur Iskhodzhanov
SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188261 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-27[MSan] Rename __msan_unpoision_param to __msan::UnpoisonParam - it shouldn't ↵Alexey Samsonov
be in interface git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185062 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-06-04[sanitizer] Fix __sanitizer_unaligned_* to work with unaligned data types.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183224 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-04[msan] Implement __sanitizer_unaligned_*.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183221 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-16[msan] Intercept dl_iterate_phdr.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182004 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-03-11[msan] intercept dlopen and clear shadow for itReid Kleckner
Summary: The loader does not call mmap() through the PLT because it has to bootstrap the process before libc is present. Hooking dlopen() isn't enough either because the loader runs module initializers before returning, and they could run arbitrary msan instrumented code. If msandr is present, then we can intercept the mmaps from dlopen at the syscall layer and clear the shadow there. If msandr is missing, we clear the shadow after dlopen() and hope any initializers are trivial. Reviewers: eugenis CC: kcc, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D509 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176818 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13[msan] don't check shadow inside interceptors if we are inside symbolizer; ↵Kostya Serebryany
add weak function __msan_default_options that overrides default options git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175040 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[Sanitizer] update style checker script and fix namespace style warningsAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173910 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