summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce `AddressSpaceView` template parameter to `SizeClassAllocator64`.Dan Liew2018-12-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: This is a follow up patch to r349138. This patch makes a `AddressSpaceView` a type declaration in the allocator parameters used by `SizeClassAllocator64`. For ASan, LSan, and the unit tests the AP64 declarations have been made templated so that `AddressSpaceView` can be changed at compile time. For the other sanitizers we just hard-code `LocalAddressSpaceView` because we have no plans to use these allocators in an out-of-process manner. rdar://problem/45284065 Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D55764 llvm-svn: 349954
* Introduce `AddressSpaceView` template parameter to `SizeClassAllocator32`, ↵Dan Liew2018-12-141-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FlatByteMap`, and `TwoLevelByteMap`. Summary: This is a follow up patch to r346956 for the `SizeClassAllocator32` allocator. This patch makes `AddressSpaceView` a template parameter both to the `ByteMap` implementations (but makes `LocalAddressSpaceView` the default), some `AP32` implementations and is used in `SizeClassAllocator32`. The actual changes to `ByteMap` implementations and `SizeClassAllocator32` are very simple. However the patch is large because it requires changing all the `AP32` definitions, and users of those definitions. For ASan and LSan we make `AP32` and `ByteMap` templateds type that take a single `AddressSpaceView` argument. This has been done because we will instantiate the allocator with a type that isn't `LocalAddressSpaceView` in the future patches. For the allocators used in the other sanitizers (i.e. HWAsan, MSan, Scudo, and TSan) use of `LocalAddressSpaceView` is hard coded because we do not intend to instantiate the allocators with any other type. In the cases where untemplated types have become templated on a single `AddressSpaceView` parameter (e.g. `PrimaryAllocator`) their name has been changed to have a `ASVT` suffix (Address Space View Type) to indicate they are templated. The only exception to this are the `AP32` types due to the desire to keep the type name as short as possible. In order to check that template is instantiated in the correct a way a `static_assert(...)` has been added that checks that the `AddressSpaceView` type used by `Params::ByteMap::AddressSpaceView` matches the `Params::AddressSpaceView`. This uses the new `sanitizer_type_traits.h` header. rdar://problem/45284065 Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov Subscribers: mgorny, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D54904 llvm-svn: 349138
* Correct atexit(3) support in MSan/NetBSDKamil Rytarowski2018-11-101-3/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The NetBSD specific implementation of cxa_atexit() does not preserve the 2nd argument if dso is equal to NULL. Changes: - Split paths of handling intercepted __cxa_atexit() and atexit(3). This affects all supported Operating Systems. - Add a local stack-like structure to hold the __cxa_atexit() context. atexit(3) is documented in the C standard as calling callback from the earliest to the oldest entry. This path also fixes potential ABI problem of passing an argument to a function from the atexit(3) callback mechanism. - Allow usage of global vars with ctors in interceptors. This allows to use Vector without automatic cleaning up the structures. This code has been modeled after TSan implementation for the same functions. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc Reviewed By: vitalybuka Subscribers: delcypher, devnexen, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40714 llvm-svn: 346579
* Disable recursive interception for tzset in MSanKamil Rytarowski2018-11-041-0/+1
| | | | | | | This fixes sanitization of this library call on NetBSD. Extracted as a part of D42050. llvm-svn: 346098
* Handle NetBSD symbol mangling for tzsetKamil Rytarowski2018-10-301-0/+1
| | | | | | | | Native code generated on NetBSD mangles tzet to __tzset50. Handle this accordingly in MSan. llvm-svn: 345571
* [sanitizer] Fix mallopt interceptor.Evgeniy Stepanov2018-10-251-1/+1
| | | | | | On error, mallopt is supposed to return 0, not -1. llvm-svn: 345323
* Skip unsupported MSan tests on NetBSDKamil Rytarowski2018-10-091-0/+4
| | | | | | libm functions remquol and lgammal are missing on NetBSD. llvm-svn: 344042
* [MSan] store origins for variadic function parameters in ↵Alexander Potapenko2018-09-061-0/+6
| | | | | | | | | | | | | | | | | __msan_va_arg_origin_tls Add the __msan_va_arg_origin_tls TLS array to keep the origins for variadic function parameters. Change the instrumentation pass to store parameter origins in this array. This is a reland of r341528. test/msan/vararg.cc doesn't work on Mips, PPC and AArch64 (because this patch doesn't touch them), XFAIL these arches. Also turned out Clang crashed on i80 vararg arguments because of incorrect origin type returned by getOriginPtrForVAArgument() - fixed it and added a test. llvm-svn: 341554
* [MSan] revert r341528 to unbreak the botsAlexander Potapenko2018-09-061-6/+0
| | | | llvm-svn: 341541
* [MSan] store origins for variadic function parameters in ↵Alexander Potapenko2018-09-061-0/+6
| | | | | | | | | | __msan_va_arg_origin_tls Add the __msan_va_arg_origin_tls TLS array to keep the origins for variadic function parameters. Change the instrumentation pass to store parameter origins in this array. llvm-svn: 341528
* [hwasan] Provide __sanitizer_* aliases to allocator functions.Evgeniy Stepanov2018-08-131-2/+2
| | | | | | | | | | | | | | | | Summary: Export __sanitizer_malloc, etc as aliases to malloc, etc. This way users can wrap sanitizer malloc, even in fully static binaries. Both jemalloc and tcmalloc provide similar aliases (je_* and tc_*). Reviewers: vitalybuka, kcc Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D50570 llvm-svn: 339614
* sanitizers: consistently check result of MmapFixedNoReserveDmitry Vyukov2018-07-202-2/+3
| | | | | | | | | | | | | | | | MmapFixedNoReserve does not terminate process on failure. Failure to check its result and die will always lead to harder to debug crashes later in execution. This was observed in Go processes due to some address space conflicts. Consistently check result of MmapFixedNoReserve. While we are here also add warn_unused_result attribute to prevent such bugs in future and change return type to bool as that's what all callers want. Reviewed in https://reviews.llvm.org/D49367 llvm-svn: 337531
* [CMake] Add compiler-rt header files to the list of sources for targetsDan Liew2018-07-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when building with an IDE so that header files show up in the UI. This massively improves the development workflow in IDEs. To implement this a new function `compiler_rt_process_sources(...)` has been added that adds header files to the list of sources when the generator is an IDE. For non-IDE generators (e.g. Ninja/Makefile) no changes are made to the list of source files. The function can be passed a list of headers via the `ADDITIONAL_HEADERS` argument. For each runtime library a list of explicit header files has been added and passed via `ADDITIONAL_HEADERS`. For `tsan` and `sanitizer_common` a list of headers was already present but it was stale and has been updated to reflect the current state of the source tree. The original version of this patch used file globbing (`*.{h,inc,def}`) to find the headers but the approach was changed due to this being a CMake anti-pattern (if the list of headers changes CMake won't automatically re-generate if globbing is used). The LLVM repo contains a similar function named `llvm_process_sources()` but we don't use it here for several reasons: * It depends on the `LLVM_ENABLE_OPTION` cache variable which is not set in standalone compiler-rt builds. * We would have to `include(LLVMProcessSources)` which I'd like to avoid because it would include a bunch of stuff we don't need. Differential Revision: https://reviews.llvm.org/D48422 llvm-svn: 336663
* [MSan] Add functions to enable/disable interceptor checks.Matt Morehouse2018-07-062-0/+9
| | | | | | | | | | | | | | | | | | 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
* [sanitizer] Use confstr to check libc version in InitTlsSizeVitaly Buka2018-06-171-1/+1
| | | | | | | | | | Reviewers: Lekensteyn, jakubjelinek Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D48265 llvm-svn: 334912
* [MSan] Linker-initialize static fallback_mutex in msan_allocator.ccAlex Shlyapnikov2018-06-141-1/+1
| | | | | | | | | | | | | | | | Summary: static fallback_mutex in msan_allocator.cc does not need the ctor call and can be linker initialized. Issue: https://github.com/google/sanitizers/issues/194 Reviewers: morehouse, eugenis Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48145 llvm-svn: 334749
* Disable MSan tests of prlimit on FreeBSDDimitry Andric2018-06-131-1/+1
| | | | | | | Like NetBSD, FreeBSD does not have prlimit(2), so do not attempt to use it during the MSan tests. llvm-svn: 334659
* [sanitizer] Add fgets, fputs and puts into sanitizer_commonPeter Wu2018-06-111-10/+0
| | | | | | | | | | | | | | | Summary: Add fgets, fputs and puts to sanitizer_common. This adds ASAN coverage for these functions, extends MSAN support from fgets to fputs/puts and extends TSAN support from puts to fputs. Fixes: https://github.com/google/sanitizers/issues/952 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D46545 llvm-svn: 334450
* [MSan] Report proper error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov2018-06-088-25/+78
| | | | | | | | | | | | | | | | | | Summary: Following up on and complementing D44404. Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, not stack, no details, not too helpful nor informative. To improve the situation, detailed and structured errors were defined and reported under the appropriate conditions. Reviewers: eugenis Subscribers: srhines, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47793 llvm-svn: 334338
* Disable recursive interceptors in signal(3)/MSanKamil Rytarowski2018-06-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: signal(3) on NetBSD calls internally sigaction(2). Without disabling the recursive interceptor, there are false positives about uninitialized memory reads inside libc. This change fixes execution of such programs as sh(1) and vmstat(1) in the NetBSD userland. Sponsored by <The NetBSD Foundation> Reviewers: eugenis, vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D47650 llvm-svn: 334168
* Introduce CheckASLR() in sanitizersKamil Rytarowski2018-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: At least the ASan, MSan, TSan sanitizers require disabled ASLR on a NetBSD. Introduce a generic CheckASLR() routine, that implements a check for the current process. This flag depends on the global or per-process settings. There is no simple way to disable ASLR in the build process from the level of a sanitizer or during the runtime execution. With ASLR enabled sanitizers that operate over the process virtual address space can misbehave usually breaking with cryptic messages. This check is dummy for !NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: cryptoad, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D47442 llvm-svn: 333985
* Port msan_test.cc to NetBSDKamil Rytarowski2018-05-191-61/+76
| | | | | | | | | | | | | | | | | | | | | Summary: The changes allows building this file on NetBSD, mostly by disabling the unsupported functions and adding OS-specific system includes. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D46712 llvm-svn: 332791
* [msan] Don't check divisor shadow in fdiv.Evgeniy Stepanov2018-05-181-1/+0
| | | | | | | | | | | | | | | | Summary: Floating point division by zero or even undef does not have undefined behavior and may occur due to optimizations. Fixes https://bugs.llvm.org/show_bug.cgi?id=37523. Reviewers: kcc Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D47085 llvm-svn: 332761
* [CMake] Build shared version of runtimes for FuchsiaPetr Hosek2018-05-091-1/+1
| | | | | | | | | Fuchsia is no longer treated as UNIX which means we need to explicitly enable building of shared versions of runtimes. Differential Revision: https://reviews.llvm.org/D46609 llvm-svn: 331922
* [sanitizer] Remove unneeded blank linesVitaly Buka2018-05-091-1/+0
| | | | llvm-svn: 331831
* [sanitizer] Update .clang-format in compiler-rtVitaly Buka2018-05-091-0/+2
| | | | | | Historically style is Google, but we never used AllowShortIfStatementsOnASingleLine. llvm-svn: 331829
* [sanitizer] Split Symbolizer/StackTraces from core RTSanitizerCommonKostya Kortchinsky2018-04-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Host symbolizer & stacktraces related code in their own RT: `RTSanitizerCommonSymbolizer`, which is "libcdep" by nature. Symbolizer & stacktraces specific code that used to live in common files is moved to a new file `sanitizer_symbolizer_report.cc` as is. The purpose of this is the enforce a separation between code that relies on symbolization and code that doesn't. This saves the inclusion of spurious code due to the interface functions with default visibility, and the extra data associated. The following sanitizers makefiles were modified & tested locally: - dfsan: doesn't require the new symbolizer RT - esan: requires it - hwasan: requires it - lsan: requires it - msan: requires it - safestack: doesn't require it - xray: doesn't require it - tsan: requires it - ubsan: requires it - ubsan_minimal: doesn't require it - scudo: requires it (but not for Fuchsia that has a minimal runtime) This was tested locally on Linux, Android, Fuchsia. Reviewers: alekseyshl, eugenis, dberris, kubamracek, vitalybuka, dvyukov, mcgrathr Reviewed By: alekseyshl, vitalybuka Subscribers: srhines, kubamracek, mgorny, krytarowski, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D45457 llvm-svn: 330131
* [sanitizer] Split coverage into separate RT in sanitizer_commonKostya Kortchinsky2018-03-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `sanitizer_common`'s coverage support is fairly well separated, and libcdep by default. Several sanitizers don't make use of coverage, and as far as I can tell do no benefit from the extra dependencies pulled in by the coverage public interface functions. The following sanitizers call `InitializeCoverage` explicitely: MSan, ASan, LSan, HWAsan, UBSan. On top of this, any sanitizer bundling RTUBSan should add the coverage RT as well: ASan, Scudo, UBSan, CFI (diag), TSan, MSan, HWAsan. So in the end the following have no need: DFSan, ESan, CFI, SafeStack (nolibc anyway), XRay, and the upcoming Scudo minimal runtime. I tested this with all the sanitizers check-* with gcc & clang, and in standalone on Linux & Android, and there was no issue. I couldn't test this on Mac, Fuchsia, BSDs, & Windows for lack of an environment, so adding a bunch of people for additional scrunity. I couldn't test HWAsan either. Reviewers: eugenis, vitalybuka, alekseyshl, flowerhack, kubamracek, dberris, rnk, krytarowski Reviewed By: vitalybuka, alekseyshl, flowerhack, dberris Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44701 llvm-svn: 328204
* [Fuzzer] Avoid the unnecessary rebuild of the custom libc++Petr Hosek2018-03-071-1/+1
| | | | | | | | | | | | This changes the add_custom_libcxx macro to resemble the llvm_ExternalProject_Add. The primary motivation is to avoid unnecessary libFuzzer rebuilds that are being done on every Ninja/Make invocation. The libc++ should be only rebuilt whenever the libc++ source itself changes. Differential Revision: https://reviews.llvm.org/D43213 llvm-svn: 326921
* [sanitizer] Move strxfrm interceptors into sanitizer_commonVitaly Buka2018-03-071-34/+0
| | | | llvm-svn: 326853
* [sanitizer] Move mmap interceptors into sanitizer_commonVitaly Buka2018-03-071-32/+11
| | | | | | | | | | Reviewers: devnexen, krytarowski, eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44125 llvm-svn: 326851
* [msan] Restrict -ftls-model=initial-exec to FreeBSDKamil Rytarowski2018-03-031-1/+3
| | | | | | Noted by <eugenis> in D43613 llvm-svn: 326649
* Adding Msan support to FreeBSDKamil Rytarowski2018-03-032-2/+5
| | | | | | | | | | | | | | | | | | | | Summary: Enabling the memory sanitizer support for FreeBSD, most of unit tests are compatible. - Adding fstat and stressor_r interceptors. - Updating the struct link_map access since most likely the struct Obj_Entry had been updated since. - Disabling few unit tests until further work is needed (or we can assume it can work in real world code). Patch by: David CARLIER Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Subscribers: eugenis, dim, srhines, emaste, kubamracek, mgorny, fedor.sergeev, hintonda, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43080 llvm-svn: 326644
* [MSan] Print current stack on CHECK violationAlex Shlyapnikov2018-02-262-2/+22
| | | | | | | | | | | | | | Summary: Print current stack on CHECK violation to aid debugging and match other sanitizers functionality. Reviewers: eugenis Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43692 llvm-svn: 326105
* Stop intercepting forkpty(3) and openpty(3) on NetBSDKamil Rytarowski2018-02-201-2/+16
| | | | | | | | | | | | | | | | | | | | | | | Summary: forkpty(3) and openpty(3) are part of `-lutil` and we don't intend to reimplement this system library in sanitizers. Everybody using these functions will need to use a precompiled library against MSan or other desired sanitizer. Restrict these functions to Linux-only. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43490 llvm-svn: 325585
* Prevent recursive MSan interceptors in strftime(3) like functionsKamil Rytarowski2018-02-151-0/+1
| | | | | | | | | | | | | | | | | | | Summary: This corrects intercepting this call on NetBSD without false positives. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42883 llvm-svn: 325208
* Prevent recursive MSan interceptors in fgets(3)Kamil Rytarowski2018-02-151-0/+1
| | | | | | | | | | | | | | | | | | | Summary: This corrects intercepting this call on NetBSD without false positives. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42884 llvm-svn: 325207
* Add NetBSD syscall hooks skeleton in sanitizersKamil Rytarowski2018-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Implement the skeleton of NetBSD syscall hooks for use with sanitizers. Add a script that generates the rules to handle syscalls on NetBSD: generate_netbsd_syscalls.awk. It has been written in NetBSD awk(1) (patched nawk) and is compatible with gawk. Generate lib/sanitizer_common/sanitizer_platform_limits_netbsd.h that is a public header for applications, and included as: <sanitizer_common/sanitizer_platform_limits_netbsd.h>. Generate sanitizer_syscalls_netbsd.inc that defines all the syscall rules for NetBSD. This file is modeled after the Linux specific file: sanitizer_common_syscalls.inc. Start recognizing NetBSD syscalls with existing sanitizers: ASan, ESan, HWASan, TSan, MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, dvyukov, eugenis Reviewed By: vitalybuka Subscribers: hintonda, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42048 llvm-svn: 325206
* [CMake] Remove -stdlib= which is unused when passing -nostdinc++Jonas Hahnfeld2018-02-011-0/+3
| | | | | | | | | This avoids the warnings when building with LLVM_ENABLE_LIBCXX which automatically adds -stdlib=libc++ to CMAKE_CXX_FLAGS. Differential Revision: https://reviews.llvm.org/D42238 llvm-svn: 323969
* [sanitizer] Add interceptors for readlinkat, name_to_handle_at, ↵Vitaly Buka2018-01-302-10/+7
| | | | | | | | | | | | | | | | | | | | | open_by_handle_at Summary: Also move existing readlink msan interceptor to sanitizer_common. Fixes google/sanitizers#908 Patch by Oliver Chang Reviewers: vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42630 llvm-svn: 323825
* Reland "[Fuzzer] Parametrize add_custom_libcxx"Petr Hosek2018-01-211-2/+3
| | | | | | | | | | | | | add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323054
* Revert "[Fuzzer] Parametrize add_custom_libcxx"Petr Hosek2018-01-201-2/+1
| | | | | | This reverts commit r323032: failing on the sanitizer-x86_64-linux-autoconf bot. llvm-svn: 323033
* [Fuzzer] Parametrize add_custom_libcxxPetr Hosek2018-01-201-1/+2
| | | | | | | | | | | | | add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323032
* [Sanitizers] Make common allocator agnostic to failure handling modes.Alex Shlyapnikov2018-01-171-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make common allocator agnostic to failure handling modes and move the decision up to the particular sanitizer's allocator, where the context is available (call stack, parameters, return nullptr/crash mode etc.) It simplifies the common allocator and allows the particular sanitizer's allocator to generate more specific and detailed error reports (which will be implemented later). The behavior is largely the same, except one case, the violation of the common allocator's check for "size + alignment" overflow is now reportied as OOM instead of "bad request". It feels like a worthy tradeoff and "size + alignment" is huge in this case anyway (thus, can be interpreted as not enough memory to satisfy the request). There's also a Report() statement added there. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42198 llvm-svn: 322784
* Add MSan interceptor for fstat(2)Kamil Rytarowski2018-01-031-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Add new MSan interceptor that corrects NetBSD's specific handling of fstat(2). NetBSD renames the call to __fstat50. Add new test: test/msan/fstat.cc Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41637 llvm-svn: 321765
* [MSan,TSan] Add aligned new/delete interceptors.Alex Shlyapnikov2017-12-221-1/+43
| | | | | | | | | | | | | | | Summary: Providing aligned new/delete implementations to match ASan. Unlike ASan, MSan and TSan do not perform any additional checks on overaligned memory, hence no sanitizer specific tests. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41532 llvm-svn: 321365
* Set of corrections for MSan/NetBSDKamil Rytarowski2017-12-142-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Changes: - Don't attempt to intercept GLIBC specific functions like __strtol_internal. This is required to stop intercepting it as we leak dlerror(3) for dlsym(3) that cannot manage to find a symbol. - Correct interception of fstatat(2). - Don't run a test for fgetgrent_r() that is missing on NetBSD. - Correct link_map location (offset) in Obj_Entry on x86_64 and i386. - Stop intercepting getpshared-like functions in pthread(3). This is feature is not enabled by default on NetBSD as it's unfinished. - Switch intercepting from UTMP to UTMPX functions. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, kcc Reviewed By: vitalybuka Subscribers: llvm-commits, srhines, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41053 llvm-svn: 320663
* [CMake] Support runtimes and monorepo layouts when looking for libcxxPetr Hosek2017-12-121-1/+1
| | | | | | | | | This also slightly refactors the code that's checking the directory presence which allows eliminating one unnecessary variable. Differential Revision: https://reviews.llvm.org/D40637 llvm-svn: 320446
* Add NetBSD/x86_64 mapping in MSanKamil Rytarowski2017-12-092-2/+3
| | | | | | | | | | | | | | | | | | | Summary: Reuse the Linux new mapping as it is. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41023 llvm-svn: 320218
* Revert SVN r, 319967Kamil Rytarowski2017-12-061-63/+3
| | | | | | | | "Correct atexit(3) support in MSan/NetBSD" This causes failures on Linux. llvm-svn: 319981
OpenPOWER on IntegriCloud