summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [hwasan] fix pthread_exitKostya Serebryany2018-09-061-0/+5
| | | | llvm-svn: 341594
* [hwasan] introduce __hwasan_print_memory_usageKostya Serebryany2018-09-061-0/+71
| | | | llvm-svn: 341592
* [libfuzzer] Correct typo in comment (test commit).Jonathan Metzman2018-09-061-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D51739 llvm-svn: 341569
* [libfuzzer] Fix fuzzer-oom.test on windows and reenable it.Max Moroz2018-09-061-10/+13
| | | | | | | | | | | | | | Summary: Patch by Jonathan Metzman (@metzman). Reviewers: Dor1s, morehouse Reviewed By: Dor1s Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D51735 llvm-svn: 341562
* [MSan] store origins for variadic function parameters in ↵Alexander Potapenko2018-09-061-0/+60
| | | | | | | | | | | | | | | | | __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-55/+0
| | | | llvm-svn: 341541
* [MSan] store origins for variadic function parameters in ↵Alexander Potapenko2018-09-061-0/+55
| | | | | | | | | | __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
* [libfuzzer] Temporarily disable unittests failing on Windows.Max Moroz2018-09-064-1/+4
| | | | | | | | | | | | | | | | Summary: Patch by Jonathan Metzman (@metzman). Reviewers: morehouse, Dor1s Reviewed By: Dor1s Subscribers: kcc, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D51712 llvm-svn: 341514
* [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 llvm-svn: 341495
* [hwasan] deflake a test Kostya Serebryany2018-09-051-2/+2
| | | | llvm-svn: 341480
* 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 llvm-svn: 341473
* [hwasan] print thread IDs when reporting a bug (also had to fix ↵Kostya Serebryany2018-09-052-13/+44
| | | | | | pthread_create on Linux) llvm-svn: 341438
* [hwasan] add a unique id to a thread and add debug prints for thread ↵Kostya Serebryany2018-09-041-1/+8
| | | | | | creation/destruction llvm-svn: 341428
* [libFuzzer] Enable tests on WindowsMatt Morehouse2018-09-0428-28/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 341385
* [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 llvm-svn: 341307
* [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 llvm-svn: 341306
* 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 llvm-svn: 341300
* [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 llvm-svn: 341299
* [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 llvm-svn: 341298
* [hwasan] Fix new[] with zero size.Evgeniy Stepanov2018-08-312-1/+22
| | | | | | | Fixes "allocator is out of memory trying to allocate 0x0 bytes" by always allocating at least one byte. llvm-svn: 341229
* [hwasan] more heap-buffer-overflow testsKostya Serebryany2018-08-311-5/+10
| | | | llvm-svn: 341162
* [hwasan] properly report heap-buffer-overflowKostya Serebryany2018-08-311-0/+16
| | | | llvm-svn: 341159
* [hwasan] make malloc(0) return nullptr, add basic address description for ↵Kostya Serebryany2018-08-314-2/+17
| | | | | | stack addresses llvm-svn: 341156
* [hwasan] fix the linux-only pthread_create interceptor and reinstate the two ↵Kostya Serebryany2018-08-302-0/+63
| | | | | | threaded tests llvm-svn: 341143
* [hwasan] use thread-local ring buffers to properly report heap-use-after-freeKostya Serebryany2018-08-303-3/+3
| | | | llvm-svn: 341133
* [hwasan] temporarily remove two tests to silence the botsKostya Serebryany2018-08-302-63/+0
| | | | llvm-svn: 341129
* [hwasan] simplify the thread hangling: instead of the ThreadRegistry (too ↵Kostya Serebryany2018-08-301-0/+37
| | | | | | heavy) simply maintain a linked list of Threads llvm-svn: 341111
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-301-1/+4
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 341082
* [hwasan] add a simple threaded UAF test, make it work on x86 (need to ↵Kostya Serebryany2018-08-301-0/+26
| | | | | | disable tagging in malloc with inside pthread_create) llvm-svn: 341007
* [libFuzzer] Remove mutation stats and weighted mutation selection.Max Moroz2018-08-291-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This was an experimental feature. After evaluating it with: 1) https://github.com/google/fuzzer-test-suite/tree/master/engine-comparison 2) enabling on real world fuzz targets running at ClusterFuzz and OSS-Fuzz The following conclusions were made: 1) With fuzz targets that have reached a code coverage plateau, the feature does not improve libFuzzer's ability to discover new coverage and may actually negatively impact it. 2) With fuzz targets that have not yet reached a code coverage plateau, the feature might speed up new units discovery in some cases, but it is quite rare and hard to confirm with a high level on confidence. Revert of https://reviews.llvm.org/D48054 and https://reviews.llvm.org/D49621. Reviewers: metzman, morehouse Reviewed By: metzman, morehouse Subscribers: delcypher, #sanitizers, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D51455 llvm-svn: 340976
* [hwasan] simplify the realloc implementation: always allocate/deallocate on ↵Kostya Serebryany2018-08-291-0/+35
| | | | | | realloc. This may slowdown some realloc-heavy code, but at least at this point a want simpler code. Also added a test llvm-svn: 340973
* Revert "[libFuzzer] Port to Windows"Matt Morehouse2018-08-291-4/+1
| | | | | | This reverts r340949 due to bot breakage again. llvm-svn: 340954
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-291-1/+4
| | | | | | | | | | | | | | | | | | 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. Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 340949
* Revert "[libFuzzer] Port to Windows"Matt Morehouse2018-08-281-4/+1
| | | | | | This reverts commit r340860 due to failing tests. llvm-svn: 340867
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-281-1/+4
| | | | | | | | | | | | | | | | | | | | 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: morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 340860
* [lsan] Check that leak sanitizer works in the forked processVitaly Buka2018-08-271-0/+23
| | | | | | Regression test for PR38698 llvm-svn: 340769
* Revert "[lsan] Do not check for leaks in the forked process"Vitaly Buka2018-08-271-35/+0
| | | | | | | | Users need leak reports in forks. This reverts commit r334036. llvm-svn: 340758
* [hwasan] implement detection of realloc-after-freeKostya Serebryany2018-08-241-0/+28
| | | | llvm-svn: 340593
* [hwasan] implement detection of double-free (invalid-free)Kostya Serebryany2018-08-241-0/+23
| | | | llvm-svn: 340591
* [hwasan] make error reporting look more like in asan, print the memory tag ↵Kostya Serebryany2018-08-222-22/+18
| | | | | | around the buggy access, simplify one test llvm-svn: 340470
* [tsan] Avoid calling Block_copy in the "sync" GCD interceptorsKuba Mracek2018-08-211-0/+34
| | | | | | | | | | The synchronous dispatch functions in GCD (dispatch_sync, dispatch_barrier_sync), don't make a copy of the passed block. To maintain binary compatibility, we should avoid doing that as well in TSan, as there's no reason to do that. The synchronous dispatch functions will not return before the block is actually executed. rdar://problem/42242579 Differential Revision: https://reviews.llvm.org/D50920 llvm-svn: 340342
* SafeStack: Use correct unsafe stack sizesVlad Tsyrklevich2018-08-211-0/+53
| | | | | | | | | | | | | | | | | Summary: When deallocating thread stacks, we use one thread's unsafe stack size to deallocate another thread's unsafe stack; however, the two sizes may differ. Record an unsafe stack's size in the thread stack linked list. Reviewers: pcc, eugenis Reviewed By: eugenis Subscribers: delcypher, llvm-commits, #sanitizers, kcc Differential Revision: https://reviews.llvm.org/D51016 llvm-svn: 340308
* [hwasan] Add a (almost) no-interceptor mode.Evgeniy Stepanov2018-08-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The idea behind this change is to allow sanitization of libc. We are prototyping on Bionic, but the tool interface will be general enough (or at least generalizable) to support any other libc. When libc depends on libclang_rt.hwasan, the latter can not interpose libc functions. In fact, majority of interceptors become unnecessary when libc code is instrumented. This change gets rid of most hwasan interceptors and provides interface for libc to notify hwasan about thread creation and destruction events. Some interceptors (pthread_create) are kept under #ifdef to enable testing with uninstrumented libc. They are expressed in terms of the new libc interface. The new cmake switch, COMPILER_RT_HWASAN_WITH_INTERCEPTORS, ON by default, builds testing version of the library with the aforementioned pthread_create interceptor. With the OFF setting, the library becomes more of a libc plugin. Reviewers: vitalybuka, kcc, jfb Subscribers: srhines, kubamracek, mgorny, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D50922 llvm-svn: 340216
* [msan] Remove XFAIL: freebsd from test/msan/tls_reuse.ccFangrui Song2018-08-181-1/+0
| | | | | | This passes now. llvm-svn: 340132
* [NFC] Some small test updates for Implicit Conversion sanitizer.Roman Lebedev2018-08-174-7/+84
| | | | | | Split off from D50251. llvm-svn: 339996
* Revert "Revert "[hwasan] Add __hwasan_handle_longjmp.""Evgeniy Stepanov2018-08-161-0/+28
| | | | | | | | | | | This reapplies commit r339935 with the following changes: * make longjmp test C, not C++, to avoid dependency on libc++/libstdc++ * untag pointer in memset interceptor x86_64 does not have TBI, so hwasan barely works there. Tests must be carefully written in a way that does not leak tagged pointer to system libraries. llvm-svn: 339963
* Revert "[hwasan] Add __hwasan_handle_longjmp."Evgeniy Stepanov2018-08-161-28/+0
| | | | | | This reverts commit 339935 which breaks hwasan tests on x86_64. llvm-svn: 339957
* [hwasan] Add __hwasan_handle_longjmp.Evgeniy Stepanov2018-08-161-0/+28
| | | | | | | | | | | | | | | | | Summary: A callback to annotate longjmp-like code. Unlike __asan_handle_no_return, in hwasan we can not conservatively "unpoison" the entire thread stack, because there is no such thing as unpoisoned memory. Pointer and memory tags must always match. Reviewers: vitalybuka, kcc Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D50752 llvm-svn: 339935
* [hwasan] Add malloc_fill_byte and free_fill_byte flags.Evgeniy Stepanov2018-08-161-0/+22
| | | | | | | | | | Reviewers: vitalybuka, kcc Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D50753 llvm-svn: 339932
* [hwasan] Add a basic API.Evgeniy Stepanov2018-08-151-0/+29
| | | | | | | | | | | | | | | | Summary: Add user tag manipulation functions: __hwasan_tag_memory __hwasan_tag_pointer __hwasan_print_shadow (very simple and ugly, for now) Reviewers: vitalybuka, kcc Subscribers: kubamracek, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D50746 llvm-svn: 339746
OpenPOWER on IntegriCloud