summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan
Commit message (Collapse)AuthorAgeFilesLines
...
* [Msan] Fix the shmctl unit tests to pass on FreeBSDViktor Kutuzov2015-01-301-0/+16
| | | | | | Differential Revision: http://reviews.llvm.org/D7253 llvm-svn: 227571
* [Sanitizers] Introduce GET_LINK_MAP_BY_DLOPEN_HANDLE() macroViktor Kutuzov2015-01-301-2/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D7233 llvm-svn: 227570
* Replace code dup with a macro.Yury Gribov2015-01-301-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D7172 llvm-svn: 227559
* [msan] Refactor memory layout specification and setup.Evgeniy Stepanov2015-01-272-123/+119
| | | | | | | | | | | | A flexible way of describing MSan memory layout details on various platforms. No significant functional changes, but the memory layout description that you get at verbosity=1 looks slightly different. This change includes stronger sanity checks than before. The goal of this change is to allow more than 2 application memory ranges for https://code.google.com/p/memory-sanitizer/issues/detail?id=76. llvm-svn: 227192
* [MSan] Enable MSan unit tests for all archsMohit K. Bhakkad2015-01-272-5/+5
| | | | | | | | | | Reviewers: Reviewers: eugenis, kcc, samsonov, petarj Subscribers: dsanders, sagar, lldb-commits Differential Revision: http://reviews.llvm.org/D7194 llvm-svn: 227189
* [Msan] Disable the ppoll unit test on FreeBSDViktor Kutuzov2015-01-261-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D7145 llvm-svn: 227106
* [Msan] Fix the statfs unit test to pass on FreeBSDViktor Kutuzov2015-01-261-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D7144 llvm-svn: 227100
* [msan] Better use-after-free reports.Evgeniy Stepanov2015-01-225-8/+27
| | | | | | | | | | | | | By attaching an extra integer tag to heap origins, we are able to distinguish between uninits - created by heap allocation, - created by heap deallocation (i.e. use-after-free), - created by __msan_allocated_memory call, - etc. See https://code.google.com/p/memory-sanitizer/issues/detail?id=35. llvm-svn: 226821
* [Msan] Fix the readv and preadv unit tests to pass on FreeBSDViktor Kutuzov2015-01-221-2/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D7091 llvm-svn: 226801
* [Msan] Fix the strerror_r unit test to build on FreeBSDViktor Kutuzov2015-01-221-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D7089 llvm-svn: 226800
* [Msan] Fix the DynRet unit test to build on FreeBSDViktor Kutuzov2015-01-221-2/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D7086 llvm-svn: 226799
* [msan] Fix origins in realloc.Evgeniy Stepanov2015-01-211-3/+10
| | | | | | | | | | | | | | | Fixes 2 issues in origins arising from realloc() calls: * In the in-place grow case origin for the new memory is not set at all. * In the copy-realloc case __msan_memcpy is used, which unwinds stack from inside the MSan runtime. This does not generally work (as we may be built w/o frame pointers), and produces "bad" stack trace anyway, with several uninteresting (internal) frames on top. This change also makes realloc() honor "zeroise" and "poison_in_malloc" flags. See https://code.google.com/p/memory-sanitizer/issues/detail?id=73. llvm-svn: 226674
* [msan] Refactor shadow operations.Evgeniy Stepanov2015-01-216-160/+257
| | | | | | | Move a bunch of functions to a new source file and rename some of them for consistency. No functional changes. llvm-svn: 226673
* [Msan] Fix the accept unit test to pass on FreeBSDViktor Kutuzov2015-01-211-2/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D7083 llvm-svn: 226650
* [Sanitizers] Intercept opendir()Viktor Kutuzov2015-01-212-0/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D6968 llvm-svn: 226648
* [asan] Allow changing verbosity in activation flags.Evgeniy Stepanov2015-01-202-2/+4
| | | | | | | This change removes some debug output in asan_flags.cc that was reading the verbosity level before all the flags were parsed. llvm-svn: 226566
* [Msan] Fix the readlink unit test to pass on FreeBSDViktor Kutuzov2015-01-201-1/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D7052 llvm-svn: 226554
* [Msan] Intercept stat() and fstatat() on FreeBSDViktor Kutuzov2015-01-192-12/+29
| | | | | | Differential Revision: http://reviews.llvm.org/D7051 llvm-svn: 226461
* [sanitizer] Make unrecognized flags not fatal.Evgeniy Stepanov2015-01-191-0/+2
| | | | | | Print a warning at verbosity=1 and higher instead of dying immediately. llvm-svn: 226458
* [sanitizer] Switch flag parsing to LowLevelAlloc.Evgeniy Stepanov2015-01-191-2/+2
| | | | | | | | | InternalAlloc is quite complex and its behavior may depend on the values of flags. As such, it should not be used while parsing flags. Sadly, LowLevelAlloc does not support deallocation of memory. llvm-svn: 226453
* [msan] Use internal__exit() instead of _exit().Evgeniy Stepanov2015-01-191-1/+1
| | | | llvm-svn: 226437
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-152-17/+34
| | | | | | | The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. llvm-svn: 226169
* [Msan] Fix strlen() and strnlen() interceptors to work on FreeBSDViktor Kutuzov2015-01-141-0/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D6928 llvm-svn: 225986
* [Msan] Fix use of mmap(MAP_ANONYMOUS) in the unit tests on FreeBSDViktor Kutuzov2015-01-121-2/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D6929 llvm-svn: 225688
* [Msan] Fix tests reading /proc files on FreeBSDViktor Kutuzov2015-01-121-7/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D6926 llvm-svn: 225686
* [Sanitizer] Change the runtime flag representation.Alexey Samsonov2015-01-073-73/+81
| | | | | | | | | | | This mirrors r225239 to all the rest sanitizers: ASan, DFSan, LSan, MSan, TSan, UBSan. Now the runtime flag type, name, default value and description is located in the single place in the .inc file. llvm-svn: 225327
* [Sanitizer] Improve unit tests in COMPILER_RT_DEBUG=ON mode.Alexey Samsonov2015-01-061-0/+1
| | | | | | | Propagate -DSANITIZER_DEBUG definition to unit tests. Make sure unit tests depend on compiler-rt headers. llvm-svn: 225298
* Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after ↵Alexey Samsonov2015-01-021-7/+11
| | | | | | | | | | | | | | | | initialization."" Fix test failures by introducing CommonFlags::CopyFrom() to make sure compiler doesn't insert memcpy() calls into runtime code. Original commit message: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. llvm-svn: 225088
* Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."Chandler Carruth2015-01-021-10/+7
| | | | | | | | | | We've got some internal users that either aren't compatible with this or have found a bug with it. Either way, this is an isolated cleanup and so I'm reverting it to un-block folks while we investigate. Alexey and I will be working on fixing everything up so this can be re-committed soon. Sorry for the noise and any inconvenience. llvm-svn: 225079
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-261-4/+1
| | | | | | | | This is a re-commit of r224838 + r224839, previously reverted in r224850. Test failures were likely (still can not reproduce) caused by two lit tests using the same name for an intermediate build target. llvm-svn: 224853
* Revert r224838, r224839.Evgeniy Stepanov2014-12-261-1/+4
| | | | | | Flaky failures on the build bots. llvm-svn: 224850
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-251-4/+1
| | | | llvm-svn: 224838
* [Sanitizer] Make CommonFlags immutable after initialization.Alexey Samsonov2014-12-221-7/+10
| | | | | | | | | | | | | | | | | | | Summary: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. Test Plan: regression test suite Reviewers: kcc, eugenis, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6741 llvm-svn: 224736
* [Msan] Fix msan_test.cc inclusions to build the unit tests on FreeBSDViktor Kutuzov2014-12-221-6/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D6757 llvm-svn: 224724
* [Msan] Fix uname() interception on FreeBSDViktor Kutuzov2014-12-221-4/+19
| | | | | | Differential Revision: http://reviews.llvm.org/D6738 llvm-svn: 224708
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-191-4/+6
| | | | | | | | | | Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(), so that this object can be easily tested. Enforce that ParseCommonFlagsFromString() and SetCommonFlagsDefaults() work only with singleton CommonFlags, shared across all sanitizer runtimes. llvm-svn: 224617
* [msan] Stop calling pthread_getspecific in signal handlers.Evgeniy Stepanov2014-12-172-16/+14
| | | | | | | | | | | pthread_getspecific is not async-signal-safe. MsanThread pointer is now stored in a TLS variable, and the TSD slot is used only for its destructor, and never from a signal handler. This should fix intermittent CHECK failures in MsanTSDSet. llvm-svn: 224423
* [Sanitizer] Introduce Allocator::may_return_null bool flag.Alexey Samsonov2014-12-123-6/+12
| | | | | | | | | | | | | | | | | | | | Summary: Turn "allocator_may_return_null" common flag into an Allocator::may_return_null bool flag. We want to make sure that common flags are immutable after initialization. There are cases when we want to change this flag in the allocator at runtime: e.g. in unit tests and during ASan activation on Android. Test Plan: regression test suite, real-life applications Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6623 llvm-svn: 224148
* [msan] Intercept wcsto*.Evgeniy Stepanov2014-12-082-109/+122
| | | | | | Intercept wcstod, wcstof, wcstold, wcstol, wcstoul, wcstoll, wcstoull. llvm-svn: 223650
* [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, ↵Kostya Serebryany2014-12-032-0/+7
| | | | | | compiler-rt part llvm-svn: 223314
* [msan] Change the way origin ids are built.Evgeniy Stepanov2014-12-036-106/+153
| | | | | | | | | | | | | | | | | | Previously, all origin ids were "chained" origins, i.e values of ChainedOriginDepot. This added a level of indirection for simple stack and heap allocation, which were represented as chains of length 1. This costs both RAM and CPU, but provides a joined 2**29 origin id space. It also made function (any instrumented function) entry non-async-signal-safe, but that does not really matter because memory stores in track-origins=2 mode are not async-signal-safe anyway. With this change, the type of the origin is encoded in origin id. See comment in msan_origin.h for more details. This reduces chained and stack origin id range to 2**28 each, but leaves extra 2**31 for heap origins. This change should not have any user-visible effects. llvm-svn: 223233
* [msan] Re-enable one test.Evgeniy Stepanov2014-12-031-2/+1
| | | | | | It has been fixed a long time ago. llvm-svn: 223226
* [Msan] Generalize mapping facilities to add FreeBSD supportViktor Kutuzov2014-11-284-58/+169
| | | | | | Differential Revision: http://reviews.llvm.org/D6387 llvm-svn: 222919
* [Msan] Fix some interceptors to pass initialization on FreeBSDViktor Kutuzov2014-11-271-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D6417 llvm-svn: 222885
* [Msan] Exclude non-FreeBSD interceptors on FreeBSDViktor Kutuzov2014-11-261-24/+148
| | | | | | Differential Revision: http://reviews.llvm.org/D6404 llvm-svn: 222822
* [Msan] Check returning value of DTLS_Get()Viktor Kutuzov2014-11-261-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D6403 llvm-svn: 222818
* [msan] Remove leftover MSanDR bits in tests.Evgeniy Stepanov2014-11-254-78/+1
| | | | llvm-svn: 222762
* [compiler-rt] Make the MSAN wmemset intercepter call wmemset instead of ↵Eric Fiselier2014-11-242-1/+11
| | | | | | | | | | | | | | | | | | | | memset. Fixes PR 21579 Summary: Exactly what the title says. I've tested this change against the libc++ test failures and it solves all of them. The check-msan rule also still passes. I'm not sure why it called memset originally. I can add tests if requested but currently there are no tests involving wide chars and they are a c++11 features. Reviewers: kcc, eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6352 llvm-svn: 222673
* [MSan] [MIPS] Adding support for MIPS64 (patch by Mohit Bhakkad).Alexey Samsonov2014-11-195-10/+36
| | | | | | Reviewed at http://reviews.llvm.org/D5906 llvm-svn: 222388
* [msan] Remove MSanDR and supporting code.Evgeniy Stepanov2014-11-188-185/+21
| | | | | | | | | | 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
OpenPOWER on IntegriCloud