summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan/msan_interface_internal.h
Commit message (Collapse)AuthorAgeFilesLines
* [MSan] Introduce __msan_unpoison_param().Matt Morehouse2019-05-091-0/+2
| | | | | | | | | | | | | | | | | | | Summary: This allows libFuzzer to unpoison parameter shadow before calling LLVMFuzzerTestOneInput to eliminate the false positives described in https://github.com/google/oss-fuzz/issues/2369. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, metzman, kcc Tags: #llvm Differential Revision: https://reviews.llvm.org/D61751 llvm-svn: 360379
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [MSan] Add functions to enable/disable interceptor checks.Matt Morehouse2018-07-061-0/+6
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 336447
* [compiler-rt] Do not introduce __sanitizer namespace globallyAnna Zaks2016-09-151-0/+10
| | | | | | | | | | | | 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 llvm-svn: 281657
* [msan] Add __msan_copy_shadow interface function.Evgeniy Stepanov2015-10-121-0/+3
| | | | | | This can be used to annotate copies of memory that are not observed by MSan. llvm-svn: 250124
* [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across ↵Alexey Samsonov2015-08-211-5/+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
* re-added changes due to svn config setting issuesNaomi Musgrave2015-07-171-0/+5
| | | | llvm-svn: 242589
* [msan] Fix MsanTest to pass in track_origins=2 mode.Evgeniy Stepanov2015-02-261-0/+7
| | | | llvm-svn: 230639
* [msan] Remove MSanDR and supporting code.Evgeniy Stepanov2014-11-181-19/+0
| | | | | | | | | | 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. llvm-svn: 222232
* Fix -Wcast-qual warnings in sanitizersAlexey Samsonov2014-11-131-2/+2
| | | | llvm-svn: 221936
* [Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in ↵Alexey Samsonov2014-08-121-22/+0
| | | | | | | | favor of a unified interface in <sanitizer/allocator_interface.h>. llvm-svn: 215469
* Generalize sanitizer allocator public interface.Alexey Samsonov2014-07-071-8/+3
| | | | | | | | | | | | | | 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. llvm-svn: 212469
* [msan] Chained origins re-design.Evgeniy Stepanov2014-05-211-2/+0
| | | | | | | | | | | | | | | | | 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. llvm-svn: 209284
* [msan] Prettify __msan_print_shadow.Evgeniy Stepanov2014-04-301-0/+2
| | | | | | Makes __msan_print_shadow output much more readable, adds origin info. llvm-svn: 207622
* [msan] Missing declarations for the new interface functions.Evgeniy Stepanov2014-04-181-0/+18
| | | | llvm-svn: 206586
* [msan] Kill __msan_print_param_shadow.Evgeniy Stepanov2014-04-021-2/+0
| | | | | | | It does not do what it's name says, and what it actually does is hard to describe, and is not useful at all. llvm-svn: 205415
* [msan] Add __msan_check_mem_is_initialized.Evgeniy Stepanov2014-04-021-0/+3
| | | | | | An assert()-like function that checks that a memory range is fully initialized. llvm-svn: 205413
* [msan] Implement __msan_set_death_callback.Evgeniy Stepanov2014-03-271-0/+3
| | | | llvm-svn: 204926
* [MSan] Add __msan_unpoison_string() to the public interface.Sergey Matveev2014-03-211-0/+2
| | | | | | | | 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. llvm-svn: 204448
* [msan] Origin tracking with history, compiler-rt part.Evgeniy Stepanov2014-03-181-6/+2
| | | | | | | | 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. llvm-svn: 204152
* [msan] Replace wrap_indirect_calls runtime flag with an interface method.Evgeniy Stepanov2013-12-201-0/+9
| | | | llvm-svn: 197799
* [msan] Add source file:line to stack origin reports.Evgeniy Stepanov2013-09-131-0/+2
| | | | | | Runtime library part. llvm-svn: 190686
* [msan] bool -> int to make msan_interface.h C-compatible.Evgeniy Stepanov2013-09-101-1/+1
| | | | llvm-svn: 190402
* Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where ↵Timur Iskhodzhanov2013-08-131-3/+3
| | | | | | SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used llvm-svn: 188261
* [msan] Allocator statistics interface and malloc hooks.Evgeniy Stepanov2013-08-021-0/+27
| | | | llvm-svn: 187653
* [MSan] Rename __msan_unpoision_param to __msan::UnpoisonParam - it shouldn't ↵Alexey Samsonov2013-06-271-3/+0
| | | | | | be in interface llvm-svn: 185062
* [msan] Add keep_going runtime flag.Evgeniy Stepanov2013-06-211-0/+3
| | | | llvm-svn: 184542
* [sanitizer] Fix __sanitizer_unaligned_* to work with unaligned data types.Evgeniy Stepanov2013-06-041-6/+6
| | | | llvm-svn: 183224
* [msan] Implement __sanitizer_unaligned_*.Evgeniy Stepanov2013-06-041-1/+19
| | | | llvm-svn: 183221
* [msan] Intercept dl_iterate_phdr.Evgeniy Stepanov2013-05-161-0/+3
| | | | llvm-svn: 182004
* [MSan] Make a few interface functions accept 'const void *' instead of 'void*'Alexey Samsonov2013-04-231-6/+6
| | | | llvm-svn: 180102
* [msan] intercept dlopen and clear shadow for itReid Kleckner2013-03-111-0/+4
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 176818
* [msan] don't check shadow inside interceptors if we are inside symbolizer; ↵Kostya Serebryany2013-02-131-0/+3
| | | | | | add weak function __msan_default_options that overrides default options llvm-svn: 175040
* [sanitizer] Further split private and public sanitizer headers.Evgeniy Stepanov2013-01-301-1/+1
| | | | | | And make msan_interface.h C-compatible. llvm-svn: 173928
* [Sanitizer] update style checker script and fix namespace style warningsAlexey Samsonov2013-01-301-2/+0
| | | | llvm-svn: 173910
* [msan] Cleanup public interface header.Evgeniy Stepanov2013-01-291-0/+120
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. llvm-svn: 173800
OpenPOWER on IntegriCloud