summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [hwasan] Don't handle signals on Android.Evgeniy Stepanov2018-09-051-0/+11
| | | | | | | | | | Sigtrap is used for error reporting, but all other signals are better left for the platform. In particular, sanitizer signal handlers do not dump registers or memory which makes debugging harder for no good reason. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341500 91177308-0d34-0410-b5e6-96231b3b80d8
* [libfuzzer] Replace memmem with strstr.Matt Morehouse2018-09-052-4/+3
| | | | | | | | | | | | | | | | Summary: Memmem is not available on Windows. Patch By: metzman Reviewers: morehouse Reviewed By: morehouse Subscribers: george.karpenkov, morehouse Differential Revision: https://reviews.llvm.org/D51692 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341495 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] deflake a test Kostya Serebryany2018-09-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341480 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable symbolize-deadlock.test on WindowsMax Moroz2018-09-052-3/+0
| | | | | | | | | | | | | | | | | | | Summary: Remove unneeded #include of <unistd.h> from SymbolizeDeadlock.cpp to enable compilation on Windows and enable symbolize-deadlock.test on Windows. Patch by Jonathan Metzman (@metzman). Reviewers: Dor1s Reviewed By: Dor1s Subscribers: kcc, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D51685 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341473 91177308-0d34-0410-b5e6-96231b3b80d8
* [Xray] Darwin providing defined value for weak symbols to fix linkage issueDavid Carlier2018-09-051-0/+9
| | | | | | | - Temporary hack to make the buildbot failure stop on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341445 91177308-0d34-0410-b5e6-96231b3b80d8
* Add glibc_prereq to platform limits mmsghdrBrian Cain2018-09-051-4/+5
| | | | | | | | | | | sendmmsg requires glibc >= 2.14. Fixes PR38589. Review: https://reviews.llvm.org/D51538 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341442 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] revert r341435 as it breaks the bot on aarch64Kostya Serebryany2018-09-051-11/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341441 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] fix colored outputKostya Serebryany2018-09-051-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341440 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] print thread IDs when reporting a bug (also had to fix ↵Kostya Serebryany2018-09-056-36/+80
| | | | | | pthread_create on Linux) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341438 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] use real TLS on linux to store the current thread -- this way we ↵Kostya Serebryany2018-09-051-7/+11
| | | | | | can call t->Destroy in __hwasan_thread_exit, same as on Android git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341435 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] simplify the code, NFCKostya Serebryany2018-09-054-16/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341432 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] remove stale Thread:: data members. While doing so noticed that ↵Kostya Serebryany2018-09-045-14/+14
| | | | | | GetThreadStackAndTls was always called with 'at_initialization=true', fixed that. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341431 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] add a unique id to a thread and add debug prints for thread ↵Kostya Serebryany2018-09-044-1/+24
| | | | | | creation/destruction git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341428 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] optimize internal_memset for the most performance critical case ↵Kostya Serebryany2018-09-041-0/+12
| | | | | | (16-byte-aligned) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341420 91177308-0d34-0410-b5e6-96231b3b80d8
* [libFuzzer] Enable tests on WindowsMatt Morehouse2018-09-0429-29/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable tests on Windows and make check-fuzzer pass on it. Make check-fuzzer pass on Windows by fixing libFuzzer, fixing tests, and by disabling tests on Windows. Most of these are disabled temporarily as support for the tests and the features they test will be added incrementally. Other tests will not be enabled since they require things that are not on Windows (eg: afl_driver tests). Every test that was explicitly disabled on Windows has a comment explaining why (unless obvious like merge-posix.test). The lit.cfg file was modified to support running tests on windows. fuzzer-dirs.test was fixed by making the Windows implementation print the same error message as the posix version. merge-control-file.test was fixed by making the test binary end with the ".exe" extension (on all platforms). Patch By: metzman Reviewers: morehouse Reviewed By: morehouse Subscribers: srhines, mgorny Differential Revision: https://reviews.llvm.org/D51549 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341385 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Update assembly test again.Matt Morehouse2018-09-041-4/+4
| | | | | | Previous commit incorrectly updated the read1 case. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341384 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Update assembly code check.Matt Morehouse2018-09-041-2/+2
| | | | | | | The new assembly makes our benchmark faster, so it should be safe to update the check. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341381 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Clean up some confusing code inDan Liew2018-09-031-4/+1
| | | | | | | | | | | | | | `test/asan/TestCases/Darwin/segv_read_write.c` * The `fd` arg passed to `mmap()` should be `-1`. It is not defined what passing `0` does on Darwin. * The comment about the shadow memory doesn't make any sense to me, so I'm removing it. Differential Revision: https://reviews.llvm.org/D44579 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341307 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBSan] Add CMake and lit support for configuring and running UBSanDan Liew2018-09-033-0/+69
| | | | | | | | | | | | | tests for ios, watchos, tvos, and their simulator counterparts. This commit does not make the tests actually pass. This will be handled in later commits. rdar://problem/41126835 Differential Revision: https://reviews.llvm.org/D51270 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341306 91177308-0d34-0410-b5e6-96231b3b80d8
* Give a better error message when trying to run the iossim tests and ↵Dan Liew2018-09-031-1/+5
| | | | | | | | | | | | | | `SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER` is not set in the environment. Summary: Give a better error message when trying to run the iossim tests and `SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER` is not set in the environment. Reviewers: kubamracek, george.karpenkov Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51272 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341300 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBSan] Propagate `UBSAN_OPTIONS` environment variable when running ios ↵Dan Liew2018-09-031-1/+1
| | | | | | | | | | | | | | simulator tests. rdar://problem/41126835 Reviewers: kubamracek, vsk, george.karpenkov Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51273 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341299 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBSan] Add missing `%run` prefixes to Pointer tests.Dan Liew2018-09-032-4/+4
| | | | | | | | | | | | Summary: rdar://problem/41126835 Reviewers: vsk, kubamracek Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51271 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341298 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix buildbot testDavid Carlier2018-09-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341286 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] openbsd build fixDavid Carlier2018-09-021-0/+6
| | | | | | | | | | | | | sysctl has a different signature under OpenBSD Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D51572 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341285 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] Fix new[] with zero size.Evgeniy Stepanov2018-08-313-10/+32
| | | | | | | Fixes "allocator is out of memory trying to allocate 0x0 bytes" by always allocating at least one byte. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341229 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to unbreak internal_sysctl() for MacOSXKamil Rytarowski2018-08-311-1/+2
| | | | | | | Cast the 5th argument to (void *), removing cast. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341192 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix internal_sysctl() for MacOSXKamil Rytarowski2018-08-311-1/+1
| | | | | | | Cast the first argument to (int *) removing const. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341187 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve portability of internal_sysctl()Kamil Rytarowski2018-08-312-2/+2
| | | | | | | Add an explicit cast from uptr to size_t to prevent potential type mismatch. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341183 91177308-0d34-0410-b5e6-96231b3b80d8
* Add internal_sysctl() used by FreeBSD, NetBSD, OpenBSD and MacOSXKamil Rytarowski2018-08-315-18/+34
| | | | | | | | | | | | | | | | | | | | | | | Summary: Switch local sysctl(2) calls to internal_sysctl(). This is a preparation for introduction of interceptors for the sysctl*() family of functions and switching `internal_sysctl*()` to libc calls bypassing interceptors. No functional change intended with this revision. Reviewers: vitalybuka, joerg, kcc Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D51425 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341181 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] move code around to remove an opaque class definition ↵Kostya Serebryany2018-08-312-51/+47
| | | | | | (HwasanThreadLocalMallocStorage) that had incorrect size and used 10x more than needed RAM (500K instead of 50K per thread) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341170 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] simplify the code, NFCKostya Serebryany2018-08-312-17/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341166 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] more heap-buffer-overflow testsKostya Serebryany2018-08-311-5/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341162 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] report heap-buffer-overflow location, once, not once per each live ↵Kostya Serebryany2018-08-311-41/+41
| | | | | | thread git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341160 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] properly report heap-buffer-overflowKostya Serebryany2018-08-313-6/+67
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341159 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] fix the build on Linux Ubuntu 14.04. We don't need __hwasan_shadow ↵Kostya Serebryany2018-08-311-0/+11
| | | | | | on Linux at all git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341158 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] make malloc(0) return nullptr, add basic address description for ↵Kostya Serebryany2018-08-316-2/+24
| | | | | | stack addresses git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341156 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] fix the linux-only pthread_create interceptor and reinstate the two ↵Kostya Serebryany2018-08-304-12/+77
| | | | | | threaded tests git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341143 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] use thread-local ring buffers to properly report heap-use-after-freeKostya Serebryany2018-08-308-66/+54
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341133 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] temporarily remove two tests to silence the botsKostya Serebryany2018-08-302-63/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341129 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] simplify the thread hangling: instead of the ThreadRegistry (too ↵Kostya Serebryany2018-08-307-84/+90
| | | | | | heavy) simply maintain a linked list of Threads git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341111 91177308-0d34-0410-b5e6-96231b3b80d8
* [Xray] Darwin fix variable typoDavid Carlier2018-08-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341090 91177308-0d34-0410-b5e6-96231b3b80d8
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-3012-20/+103
| | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Patch By: metzman Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341082 91177308-0d34-0410-b5e6-96231b3b80d8
* [Xray] Darwin improving slightly the supportDavid Carlier2018-08-303-3/+7
| | | | | | | | | | | | | | using sysctl to get the tic frequency data. still linkage issue for X-ray_init not resolved. Reviewers: dberris, kubamracek Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D51399 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341019 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Transition to new _zx_vmar_... callsPetr Hosek2018-08-302-18/+16
| | | | | | | | | Now that all _zx_vmar_... calls have been updated, we can undo the change made in r337801 and switch over to the new calls. Differential Revision: https://reviews.llvm.org/D51468 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341011 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] add a simple threaded UAF test, make it work on x86 (need to ↵Kostya Serebryany2018-08-305-4/+47
| | | | | | disable tagging in malloc with inside pthread_create) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341007 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] add basic ThreadRegistry plumbing, also rename HwasanThread to ThreadKostya Serebryany2018-08-307-40/+107
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341005 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] remove even more stale codeKostya Serebryany2018-08-292-33/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@340989 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] remove more stale codeKostya Serebryany2018-08-293-57/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@340985 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] get rid of some macros, remove the fixed shadow mappingKostya Serebryany2018-08-298-60/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@340983 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] formatting change, NFCKostya Serebryany2018-08-299-10/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@340980 91177308-0d34-0410-b5e6-96231b3b80d8