summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merging r366447:release_90Hans Wennborg2019-08-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r366447 | jdevlieghere | 2019-07-18 17:17:42 +0200 (Thu, 18 Jul 2019) | 19 lines [CMake] Don't set Python_ADDITIONAL_VERSIONS Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's Python support to 2.7. Now that both LLVM and LLDB both support Python 3, there's no longer a need to put an arbitrary limit on this. However, instead of removing the variable, r365692 expanded the list, which has the (presumably unintentional) side-effect of expression preference for Python 3. Instead, as Michal proposed in the original code review, we should just not set the list at all, and let CMake pick whatever Python interpreter you have in your path. This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm, clang and lld. I've also updated the docs with the default behavior and how to force a different Python version to be used. Differential revision: https://reviews.llvm.org/D64894 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@369902 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r369708 - [Sanitizer] checks ASLR on FreeBSDHans Wennborg2019-08-263-2/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@369897 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r368219 (PR42988)Hans Wennborg2019-08-201-2/+2
| | | | | | | | | | | | | Restrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC The fallback to the alternative implementation of TSD with TLS is only needed for the static version of ASan for NetBSD. The same code cannot be reused for the dynamic version of ASan as TLS breaks and TSD code works. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@369341 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r368246 for PR42988Hans Wennborg2019-08-201-0/+6
| | | | | | | | | | Update generate_netbsd_ioctls.awk for NetBSD 9.99.3 Register new ioctl argument types passed in ioctl(2) calls. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@369340 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r368247 (requested in PR42988)Hans Wennborg2019-08-203-7/+127
| | | | | | | | | | | Sync ioctl(2) list with NetBSD 9.99.3 Register 36 new ioctl(2) calls. Enable NVMM for amd64 as the API has been stabilized. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@369339 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r368516:Hans Wennborg2019-08-133-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r368516 | dim | 2019-08-10 21:07:38 +0200 (Sat, 10 Aug 2019) | 25 lines Add support for FreeBSD's LD_32_LIBRARY_PATH Summary: Because the dynamic linker for 32-bit executables on 64-bit FreeBSD uses the environment variable `LD_32_LIBRARY_PATH` instead of `LD_LIBRARY_PATH` to find needed dynamic libraries, running the 32-bit parts of the dynamic ASan tests will fail with errors similar to: ``` ld-elf32.so.1: Shared object "libclang_rt.asan-i386.so" not found, required by "Asan-i386-inline-Dynamic-Test" ``` This adds support for setting up `LD_32_LIBRARY_PATH` for the unit and regression tests. It will likely also require a minor change to the `TestingConfig` class in `llvm/utils/lit/lit`. Reviewers: emaste, kcc, rnk, arichardson Reviewed By: arichardson Subscribers: kubamracek, krytarowski, fedor.sergeev, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D65772 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@368680 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r368103 '[TSAN] Fix tsan on FreeBSD after D54889'Hans Wennborg2019-08-092-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@368426 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r367929:Hans Wennborg2019-08-061-1/+1
| | | | | | | | | | | | | | | ------------------------------------------------------------------------ r367929 | echristo | 2019-08-05 23:25:59 +0200 (Mon, 05 Aug 2019) | 5 lines BMI2 support is indicated in bit eight of EBX, not nine. See Intel SDM, Vol 2A, Table 3-8: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf#page=296 Differential Revision: https://reviews.llvm.org/D65766 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@367996 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r367442:Hans Wennborg2019-08-016-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r367442 | arichardson | 2019-07-31 18:31:55 +0200 (Wed, 31 Jul 2019) | 30 lines [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD Summary: MSAN was broken on FreeBSD by https://reviews.llvm.org/D55703: after this change accesses to the key variable call __tls_get_addr, which is intercepted. The interceptor then calls GetCurrentThread which calls MsanTSDGet which again calls __tls_get_addr, etc... Using the default implementation in the SANITIZER_FREEBSD case fixes MSAN for me. I then applied the same change to ASAN (introduced in https://reviews.llvm.org/D55596) but that did not work yet. In the ASAN case, we get infinite recursion again during initialization, this time because calling pthread_key_create() early on results in infinite recursion. pthread_key_create() calls sysctlbyname() which is intercepted but COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED returns true, so the interceptor calls internal_sysctlbyname() which then ends up calling the interceptor again. I fixed this issue by using dlsym() to get the libc version of sysctlbyname() instead. This fixes https://llvm.org/PR40761 Reviewers: vitalybuka, krytarowski, devnexen, dim, bsdjhb, #sanitizers, MaskRay Reviewed By: MaskRay Subscribers: MaskRay, emaste, kubamracek, jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D65221 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@367524 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r366413 on LLVM 9 branchUlrich Weigand2019-07-222-49/+2
| | | | | | | | | This commit caused test suite failures on multiple platforms and has been reverted on mainline as r366472/r366482. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@366690 91177308-0d34-0410-b5e6-96231b3b80d8
* Creating release_90 branch off revision 366426Hans Wennborg2019-07-180-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_90@366428 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix asan infinite loop on undefined symbolSerge Guelton2019-07-182-2/+49
| | | | | | | | Fix llvm#39641 Differential Revision: https://reviews.llvm.org/D63877 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366413 91177308-0d34-0410-b5e6-96231b3b80d8
* hwasan: Use C++ driver for cfi.cc test.Peter Collingbourne2019-07-171-1/+1
| | | | | | | | | | | | | | It turns out that this test was only passing by accident. It was relying on the optimizer to remove the only reference to A's vtable by realizing that the CFI check will always fail. The vtable contains a reference to RTTI in libc++, which will be unresolved because the C driver won't link against it. This was found by my prototype implementation of HWASAN for globals, which happens to end up preserving the reference. Differential Revision: https://reviews.llvm.org/D64890 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366389 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Support `{f}puts(NULL)` on DarwinJulian Lettner2019-07-172-2/+20
| | | | | | | | | | | | | On Darwin, the man page states that "both fputs() and puts() print `(null)' if str is NULL." rdar://48227136 Reviewed By: Lekensteyn Differential Revision: https://reviews.llvm.org/D64773 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366342 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.6Julian Lettner2019-07-161-45/+44
| | | | | | | Cleanup ARM64 assembly after removing unnecessary computation of mangled stack pointer in previous commit. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366258 91177308-0d34-0410-b5e6-96231b3b80d8
* [GWP-ASan] Add thread ID to PRNG seed.Mitch Phillips2019-07-162-5/+7
| | | | | | | | | | | | | | | | | | | Summary: Adds thread ID to PRNG seed for increased entropy. In particular, this allows multiple runs in quick succession that will have different PRNG seeds, allowing for better demos/testing. Reviewers: kcc Reviewed By: kcc Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D64453 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366253 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed -mno-omit-leaf-frame-pointer from flags.Mitch Phillips2019-07-162-6/+0
| | | | | | | Removes -mno-omit-leaf-frame-pointer from Scudo and GWP-ASan's CFlags. Attempt to fix the sanitizer buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366228 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.10Julian Lettner2019-07-162-64/+0
| | | | | | | Remove now-unused assembly code for determining xor key on Linux/AArch64. This is the final commit of this refactoring. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366225 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish "Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFO"Stephan Bergmann2019-07-164-20/+81
| | | | | | | | | | | | | | | | | | | | | i.e., recent 5745eccef54ddd3caca278d1d292a88b2281528b: * Bump the function_type_mismatch handler version, as its signature has changed. * The function_type_mismatch handler can return successfully now, so SanitizerKind::Function must be AlwaysRecoverable (like for SanitizerKind::Vptr). * But the minimal runtime would still unconditionally treat a call to the function_type_mismatch handler as failure, so disallow -fsanitize=function in combination with -fsanitize-minimal-runtime (like it was already done for -fsanitize=vptr). * Add tests. Differential Revision: https://reviews.llvm.org/D61479 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366186 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix asm token error (again)Julian Lettner2019-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366150 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix >80 character line.Matt Morehouse2019-07-151-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366136 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix asm token errorJulian Lettner2019-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366131 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.9Julian Lettner2019-07-151-22/+5
| | | | | | | Switch over to computing the xor key in C, instead of assembly for Linux/AArch64. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366126 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizers][windows][mingw32] Mingw32 RTL fixesMatthew G McGovern2019-07-151-44/+44
| | | | | | | | | RTL interception broke mingw32, this should fix those builds by removing dependency on windows.h reviewed in https://reviews.llvm.org/D64694 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366105 91177308-0d34-0410-b5e6-96231b3b80d8
* [libFuzzer] Disable fork.test on AArch64Diana Picus2019-07-151-1/+1
| | | | | | This crashes sporadically on our AArch64 buildbots. Disable for now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366055 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Tiny cleanup of UnmangleLongJmpSp for Linux/x86_64Julian Lettner2019-07-131-8/+8
| | | | | | NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365982 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Fix assembly in arm sync-ops.hNikita Popov2019-07-121-1/+1
| | | | | | | | | This assembly is part of a macro that was reformatted in D60351. The missing space between push and { results in: Error: bad instruction `push{r4, r5,r6,lr}' git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365957 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable compiler-rt on SPARCRainer Orth2019-07-129-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables compiler-rt on SPARC targets. Most of the changes are straightforward: - Add 32 and 64-bit sparc to compiler-rt - lib/builtins/fp_lib.h needed to check if the int128_t and uint128_t types exist (which they don't on sparc) There's one issue of note: many asan tests fail to compile on Solaris/SPARC: fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported. Therefore, while asan is still built, both asan and ubsan-with-asan testing is disabled. The goal is to check if asan keeps compiling on Solaris/SPARC. This serves asan in gcc, which doesn't have the problem above and works just fine. With this patch, sparcv9-sun-solaris2.11 test results are pretty good: Failing Tests (9): Builtins-sparc-sunos :: divtc3_test.c Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c Builtins-sparcv9-sunos :: divtc3_test.c [...] UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp The builtin failures are due to Bugs 42493 and 42496. The tree contained a few additonal patches either currently in review or about to be submitted. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D40943 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365880 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizers] Fix SanitizerCommon-Unit :: ↵Rainer Orth2019-07-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | ./Sanitizer-*-Test/MemoryMappingLayout.DumpListOfModules on Solaris The MemoryMappingLayout.DumpListOfModules currently FAILs on Solaris: [ RUN ] MemoryMappingLayout.DumpListOfModules /vol/llvm/src/compiler-rt/local/lib/sanitizer_common/tests/sanitizer_procmaps_test.cc:52: Failure Value of: found Actual: false Expected: true [ FAILED ] MemoryMappingLayout.DumpListOfModules (22 ms) The problem is that the test expects the executable name from modules[i].full_name(), however the pr_mapname field of struct prmap is just the entry in /proc/<pid>/object, which is "a.out" instead of "Sanitizer-i386-Test". Fortunately, the real name can be determined by looking in proc/<pid>/path where "a.out" is a symlink to the real path. Tested on x86_64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D64559 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365879 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Unforget a colon in a few CHECK: directives.Artem Dergachev2019-07-121-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D64526 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365863 91177308-0d34-0410-b5e6-96231b3b80d8
* Use clang driver for libfuzzer tests on WindowsReid Kleckner2019-07-112-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There's no real reason to use clang-cl on Windows, the clang driver works just as well. This fixes a test which uses the -O0 flag, which was recently removed from clang-cl to match MSVC, which lacks this flag. While I'm here, remove the explicit -std=c++11 flag. Previously, this flag was necessary when the default C++ standard was C++98. Now that the default is C++14, this is no longer necessary. It's problematic on Windows, because the Visual C++ standard library relies on C++14 features, and attempting to compile it with C++11 results in errors. Rather than adding logic to conditionally set the standard to C++11 only on non-Win, this flag can be removed. See http://lab.llvm.org:8011/builders/clang-x64-windows-msvc and https://reviews.llvm.org/D64506. Reviewers: morehouse, thakis Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D64587 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365841 91177308-0d34-0410-b5e6-96231b3b80d8
* [scudo][standalone] NFC correctionsKostya Kortchinsky2019-07-117-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A few corrections: - rename `TransferBatch::MaxCached` to `getMaxCached` to conform with the style guide; - move `getBlockBegin` from `Chunk::` to `Allocator::`: I believe it was a fallacy to have this be a `Chunk` method, as chunks' relationship to backend blocks are up to the frontend allocator. It makes more sense now, particularly with regard to the offset. Update the associated chunk test as the method isn't available there anymore; - add a forgotten `\n` to a log string; - for `releaseToOs`, instead of starting at `1`, start at `0` and `continue` on `BatchClassId`: in the end it's identical but doesn't assume a particular class id for batches; - change a `CHECK` to a `reportOutOfMemory`: it's a clearer message Reviewers: hctim, morehouse, eugenis, vitalybuka Reviewed By: hctim Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D64570 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365816 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Move DECLARE_REAL macro outside of namespaceJulian Lettner2019-07-111-5/+15
| | | | | | | This should fix the "undefined reference to tsan::interception::real_setjmp" linker errors. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365806 91177308-0d34-0410-b5e6-96231b3b80d8
* [profile][test] Fix Profile-* :: instrprof-merge.c etc. on SPARCRainer Orth2019-07-113-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While working on https://reviews.llvm.org/D40900 (which effectively is about enabling compiler-rt on sparc these days), I came across two failing profile testcases: Profile-sparc :: instrprof-merge-match.test Profile-sparc :: instrprof-merge.c Profile-sparcv9 :: instrprof-merge-match.test Profile-sparcv9 :: instrprof-merge.c All of them crashed with a SIGBUS in __llvm_profile_merge_from_buffer: Thread 2 received signal SIGSEGV, Segmentation fault. [Switching to Thread 1 (LWP 1)] 0x00012368 in __llvm_profile_merge_from_buffer ( ProfileData=0x2384c <main.Buffer> "\377lprofR\201", ProfileSize=360) at /vol/llvm/src/llvm/local/projects/compiler-rt/lib/profile/InstrProfilingMerge.c:95 95 SrcDataEnd = SrcDataStart + Header->DataSize; where Header is insufficiently aligned for a strict-alignment target like SPARC. Fixed by forcing the alignment to uint64_t, the members of struct __llvm_profile_header, in the callers. Tested on sparcv9-sun-solaris2.11. https://reviews.llvm.org/D64498 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365805 91177308-0d34-0410-b5e6-96231b3b80d8
* Explicitly define __STDC_FORMAT_MACROS for PRIu64Mitch Phillips2019-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | Summary: Builds are failing on RHEL machines because of PRIu64. lvm/projects/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp:420:50: error: expected ')' `snprintf(ThreadBuffer, kThreadBufferLen, "%" PRIu64, ThreadID);` inttypes.h in RHEL uses PRIu64 macros only when __STDC_FORMAT_MACROS is defined. Author: DTharun Reviewers: hctim Reviewed By: hctim Differential Revision: https://reviews.llvm.org/D64388 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365801 91177308-0d34-0410-b5e6-96231b3b80d8
* [scudo][standalone] Merge Spin & Blocking mutex into a Hybrid oneKostya Kortchinsky2019-07-1117-158/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We ran into a problem on Fuchsia where yielding threads would never be deboosted, ultimately resulting in several threads spinning on the same TSD, and no possibility for another thread to be scheduled, dead-locking the process. While this was fixed in Zircon, this lead to discussions about if spinning without a break condition was a good decision, and settled on a new hybrid model that would spin for a while then block. Currently we are using a number of iterations for spinning that is mostly arbitrary (based on sanitizer_common values), but this can be tuned in the future. Since we are touching `common.h`, we also use this change as a vehicle for an Android optimization (the page size is fixed in Bionic, so use a fixed value too). Reviewers: morehouse, hctim, eugenis, dvyukov, vitalybuka Reviewed By: hctim Subscribers: srhines, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D64358 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365790 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Use __sanitizer_fill_shadow for FastPoisonShadow on FuchsiaPetr Hosek2019-07-111-4/+6
| | | | | | | | This is the optimized implementation for Fuchsia provided by the libc. Differential Revision: https://reviews.llvm.org/D64166 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365739 91177308-0d34-0410-b5e6-96231b3b80d8
* Add NetBSD LSan supportKamil Rytarowski2019-07-1111-19/+394
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Combine few relatively small changes into one: - implement internal_ptrace() and internal_clone() for NetBSD - add support for stoptheworld based on the ptrace(2) API - define COMPILER_RT_HAS_LSAN for NetBSD - enable tests for NetBSD/amd64 Inspired by the original implementation by Christos Zoulas in netbsd/src for GCC. The implementation is in theory CPU independent through well defined macros across all NetBSD ports, however only the x86_64 version was tested. Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb Reviewed By: vitalybuka Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos Tags: #llvm Differential Revision: https://reviews.llvm.org/D64057 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365735 91177308-0d34-0410-b5e6-96231b3b80d8
* Change another test I missed in r365724Nico Weber2019-07-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365725 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Remove -O0 optionNico Weber2019-07-1189-121/+121
| | | | | | | | | | | | cl.exe doesn't understand it; there's /Od instead. See also the review thread for r229575. Update lots of compiler-rt tests to use -Od instead of -O0. Ran `rg -l 'clang_cl.*O0' compiler-rt/test/ | xargs sed -i -c 's/-O0/-Od/'` Differential Revision: https://reviews.llvm.org/D64506 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365724 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix linker error on Linux/AArch64Julian Lettner2019-07-101-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365707 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix compiler error on Linux/AArch64Julian Lettner2019-07-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365693 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Attempt to fix linker error on Linux/AArch64Julian Lettner2019-07-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365681 91177308-0d34-0410-b5e6-96231b3b80d8
* [ubsan][test] Restore float-divide-by-zero testFangrui Song2019-07-101-0/+1
| | | | | | Removed by rCTE365307 to fix buildbots. It can be restored now because D64317/rC365587 brought back -fsanitize=float-divide-by-zero git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365591 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-091-9/+51
| | | | | | | | | | | | | | | | | | pt.8" Fix compilation errors related to `SANITIZER_GO` `#ifdef`s. Refine longjmp key management. For Linux, re-implement key retrieval in C (instead of assembly). Removal of `InitializeGuardPtr` and a final round of cleanups will be done in the next commit. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64092 llvm-svn: 365513 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365560 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Refine longjmp key management on DarwinJulian Lettner2019-07-091-5/+6
| | | | | | NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365554 91177308-0d34-0410-b5e6-96231b3b80d8
* hwasan: Improve precision of checks using short granule tags.Peter Collingbourne2019-07-099-191/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A short granule is a granule of size between 1 and `TG-1` bytes. The size of a short granule is stored at the location in shadow memory where the granule's tag is normally stored, while the granule's actual tag is stored in the last byte of the granule. This means that in order to verify that a pointer tag matches a memory tag, HWASAN must check for two possibilities: * the pointer tag is equal to the memory tag in shadow memory, or * the shadow memory tag is actually a short granule size, the value being loaded is in bounds of the granule and the pointer tag is equal to the last byte of the granule. Pointer tags between 1 to `TG-1` are possible and are as likely as any other tag. This means that these tags in memory have two interpretations: the full tag interpretation (where the pointer tag is between 1 and `TG-1` and the last byte of the granule is ordinary data) and the short tag interpretation (where the pointer tag is stored in the granule). When HWASAN detects an error near a memory tag between 1 and `TG-1`, it will show both the memory tag and the last byte of the granule. Currently, it is up to the user to disambiguate the two possibilities. Because this functionality obsoletes the right aligned heap feature of the HWASAN memory allocator (and because we can no longer easily test it), the feature is removed. Also update the documentation to cover both short granule tags and outlined checks. Differential Revision: https://reviews.llvm.org/D63908 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365551 91177308-0d34-0410-b5e6-96231b3b80d8
* [libFuzzer] Include FuzzedDataProvider.h in the test without "utils" subdir.Max Moroz2019-07-092-1/+3
| | | | | | | | | | | | | | | | | | Summary: This way the test would better match the intended usage of the header, plus it makes some additional testing (e.g. in CI) a bit easier to set up. Reviewers: morehouse Reviewed By: morehouse Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D64440 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365544 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-092-51/+10
| | | | | | | | pt.8" This reverts commit 521f77e6351fd921f5a81027c7c72addca378989. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365534 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.8Julian Lettner2019-07-092-10/+51
| | | | | | | | | | | | Refine longjmp key management. For Linux, re-implement key retrieval in C (instead of assembly). Removal of `InitializeGuardPtr` and a final round of cleanups will be done in the next commit. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64092 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365513 91177308-0d34-0410-b5e6-96231b3b80d8