summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* [lsan] Use SANITIZER_WORDSIZE when selecting ByteMapVitaly Buka2019-04-265-13/+34
| | | | | | | Originally this code was added for 64-bit platform and it was never update. Add static_assert to validate type of ByteMap. llvm-svn: 359286
* Revert "[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap"Vitaly Buka2019-04-265-34/+13
| | | | | | | | New static_assert fails on a bot. This reverts commit r359269. llvm-svn: 359276
* NFC: Clang-format msan_allocator.ccVitaly Buka2019-04-261-61/+61
| | | | llvm-svn: 359270
* [lsan] Use SANITIZER_WORDSIZE when selecting ByteMapVitaly Buka2019-04-265-13/+34
| | | | | | | Originally this code as added for 64-bit platform and was never changed. Add static_assert to make sure that we have correct map on all platforms. llvm-svn: 359269
* [libFuzzer] Disable MSan interceptors in SIGINT handler.Matt Morehouse2019-04-262-1/+19
| | | | | | | | | | | | | | | | | | | | | | Summary: Avoids an MSan false positive if the SIGINT comes while the user callback is running. The false positive happens when the interrupt handler calls opendir() to remove some temporary files, which is intercepted by MSan. Fixes https://github.com/google/oss-fuzz/issues/2332. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, Dor1s, metzman Tags: #llvm Differential Revision: https://reviews.llvm.org/D61163 llvm-svn: 359254
* [libFuzzer] Require linux for libcxx.testMatt Morehouse2019-04-251-0/+1
| | | | llvm-svn: 359223
* [compiler-rt] Build custom libc++abi without exceptions.Matt Morehouse2019-04-252-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Since neither compiler-rt nor the libc++ we build use exceptions, we don't need libc++abi to have them either. This resolves an issue where libFuzzer's private libc++ contains implementations for __cxa_throw and friends, causing fuzz targets built with their own C++ library to segfault during exception unwinding. See https://github.com/google/oss-fuzz/issues/2328. Reviewers: phosek, EricWF, kcc Reviewed By: phosek Subscribers: kcc, dberris, mgorny, christof, llvm-commits, metzman Tags: #llvm Differential Revision: https://reviews.llvm.org/D61053 llvm-svn: 359218
* [NFC][Sanitizer] Extract GetFuncAddr from GetRealFunctionAddressJulian Lettner2019-04-253-9/+20
| | | | | | | | | | | | | | Summary: Hopefully, this will enable cleanup/removal of GetRealFunctionAddress in follow-up commits. Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61110 llvm-svn: 359213
* [scudo][standalone] Introduce the SizeClassMapKostya Kortchinsky2019-04-255-1/+190
| | | | | | | | | | | | | | | | | | | | | | Summary: As with the sanitizer_common allocator, the SCM allows for efficient mapping between sizes and size-classes, table-free. It doesn't depart significantly from the original, except that we allow the use of size-class 0 for other purposes (as opposed to chunks of size 0). The Primary will use it to hold TransferBatches. Reviewers: vitalybuka, eugenis, hctim, morehouse Reviewed By: vitalybuka Subscribers: srhines, mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D61088 llvm-svn: 359199
* [sanitizer_common] Remove some old commented-out printf statements, and ↵Mitch Phillips2019-04-241-6/+1
| | | | | | fixed up the order of includes. llvm-svn: 359150
* [compiler-rt] NFC fixed [whitespace/braces] LINT warningVitaly Buka2019-04-241-1/+1
| | | | llvm-svn: 359133
* [fuzzer] Fix reload.test on Linux/aarch64Adhemerval Zanella2019-04-241-2/+2
| | | | | | | | | | The compiler generates a 'brk' instruction for __builtin_trap on aarch64 and Linux kernel issues a SIGTRAP. It is different from x86, where compiler emits an 'ud2' and kernel issues a SIGILL. A straightforward is to use abort instead. llvm-svn: 359126
* [compiler-rt] Fix warning about virtual destructor in sanitizer_flag_parser.hVitaly Buka2019-04-241-0/+3
| | | | llvm-svn: 359125
* [llvm-symbolizer] Quick fix for broken sanitizer botMitch Phillips2019-04-241-0/+1
| | | | | | | | | | | | | | | | | | | (sanitizer-x86_64-linux) until I can triage the issue properly. The build has been broken due to the symbolizer build checks failing. As the symbolizer build script relies on the old svn repo layout, it may take a little while longer to find the responsible patch for the breakage. This may be a completely valid fix, but I will need to confirm it. For now, it unbreaks the build. Tracking data: Build where the break first occurred: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/21211 Changelist authors: @grimar, @maskray, @whitequark, @spatel, @dpreobra For the authors, no action needed (yet). Will follow up when I can identify the cause. llvm-svn: 359123
* [scudo][standalone] Introduce the Secondary allocatorKostya Kortchinsky2019-04-2414-88/+476
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The Secondary allocator wraps the platform allocation primitives. It is meant to be used for larger sizes that the Primary can't fullfill, as it will be slower, and sizes are multiple of the system page size. This also changes some of the existing code, notably the opaque platform data being passed to the platform specific functions: we can shave a couple of syscalls on Fuchsia by storing additional data (this addresses a TODO). Reviewers: eugenis, vitalybuka, hctim, morehouse Reviewed By: morehouse Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60787 llvm-svn: 359097
* The error message for mismatched value sites is very cryptic.Dmitry Mikulin2019-04-232-6/+6
| | | | | | | | Make it more readable for an average user. Differential Revision: https://reviews.llvm.org/D60896 llvm-svn: 359043
* [TSan] Support fiber API on macOSJulian Lettner2019-04-2015-43/+89
| | | | | | | | | | | | | | Committing on behalf of Yuri Per (yuri). Reviewers: dvyukov, kubamracek, yln Reviewed By: kubamracek Authored By: yuri Differential Revision: https://reviews.llvm.org/D58110 llvm-svn: 358802
* [CMake] Add fuzzer as a component for runtime buildsChris Bieneman2019-04-191-0/+2
| | | | | | Calling `add_compiler_rt_component` sets up the component connection between runtime builds and the parent CMake configuration. Adding this call allows specifying `fuzzer` as a `LLVM_RUNTIME_DISTRIBUTION_COMPONENT`. llvm-svn: 358780
* [gn] Support dots in CMake paths in the sync scriptPetr Hosek2019-04-191-1/+0
| | | | | | | | Some file paths use dots to pick up sources from parent directories. Differential Revision: https://reviews.llvm.org/D60734 llvm-svn: 358774
* Removed regiser dump checks from FP unit test.Mitch Phillips2019-04-191-41/+14
| | | | llvm-svn: 358770
* [HWASan] Added no-FP unit test for register dump.Mitch Phillips2019-04-191-12/+12
| | | | | | | | | | | | | | Summary: Unit test for D60798. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits, pcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60806 llvm-svn: 358769
* Updated test case.Mitch Phillips2019-04-191-7/+19
| | | | llvm-svn: 358768
* Added no-FP unit test for register dump.Mitch Phillips2019-04-191-0/+43
| | | | llvm-svn: 358767
* [libFuzzer] revert part of r358726 committed by mistake (oops)Kostya Serebryany2019-04-191-1/+0
| | | | llvm-svn: 358727
* [libFuzzer] in fork mode, make sure the child stats are always collected. ↵Kostya Serebryany2019-04-192-2/+4
| | | | | | This should fix the flakiness in fork-ubsan.test llvm-svn: 358726
* [builtins] Build x86_64 with GENERIC_TF_SOURCESYi Kong2019-04-181-0/+1
| | | | llvm-svn: 358706
* Summary:Jonathan Metzman2019-04-184-33/+125
| | | | | | | | | | | | | | | | | | | | | | Add close_fd_mask functionality to AFL driver. Summary: Add support for env var AFL_DRIVER_CLOSE_FD_MASK which behaves the same as libFuzzer's -close_fd_mask=1. Also add tests. Reviewers: kcc, vitalybuka, morehouse Reviewed By: morehouse Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60334 llvm-svn: 358703
* [asan_symbolize] Workaround bug in old Python 2 versions.Dan Liew2019-04-181-2/+7
| | | | | | | | | | | | | | | | | | | | | The change landed in r358657 broke some of the buildbots because they use an older version of Python 2 that raises this error. ``` File "/Volumes/data/dev/llvm/upstream/master/src/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py", line 509 exec(f.read(), globals_space, None) SyntaxError: unqualified exec is not allowed in function 'load_plugin_from_file' it contains a nested function with free variables ``` I can reproduce this problem when using Python 2.7.6. To workaround this some indirection has been added to prevent the broken (the line at fault would never be executed) SyntaxError error in old Python versions from being raised. rdar://problem/49476995 llvm-svn: 358682
* [asan_symbolize] Add a simple plugin architectureDan Liew2019-04-184-48/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change adds a simple plugin architecture to `asan_symbolize.py`. The motivation here is that sometimes it's necessary to perform extra work to figure out where binaries with debug symbols can actually be found. For example it might be the case that a remote service needs to be queried for binaries and then copied to the local system. This "extra work" can be extremely site-specific such that adding the code directly into the `asan_symbolize.py` would just clutter the code for a very niche use case. To avoid this, the `asan_symbolize.py` can now load external code via a new `--plugins` command line option. These plugins are loaded before main command line argument parsing so that they can add their own command line options. Right now the only hook into the behaviour of symbolization is the `filter_binary_path()` function which assumes a very similar role to the `binary_name_filter` function that was previously in the code. We can add more hooks as necessary. Code in the `asan_symbolize.py` script does not call plugin code directly. Instead it uses a `AsanSymbolizerPlugInProxy` object. This object * Loads plugins from files. * Manages the lifetime of the plugins. * Provides an interface for calling into plugin functions and handles calling into multiple plugins. To unify the way binary paths are filtered the old `sysroot_path_filter` function (and associated code) has been turned into a simple plugin (`SysRootFilterPlugIn`) that is always loaded. The plugin unloads itself if the `-s` option is not present on the command line. Users should not see any functional change relating to this command line option. Some simple tests are provided to illustrate what plugin code looks like and also to check the functionality continues to work. rdar://problem/49476995 Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka Subscribers: srhines, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60529 llvm-svn: 358657
* [builtins] Add __cmpsf2 for ARM version of comparesf2Yi Kong2019-04-171-0/+5
| | | | | | | | | The generic version of comparesf2 defines __cmpsf2 alias for libgcc compatibility, but the ARM overlay is missing the alias. Differential Revision: https://reviews.llvm.org/D60805 llvm-svn: 358542
* [HWASan] Fixed slow DWARF unwinding.Mitch Phillips2019-04-161-3/+3
| | | | | | | | | | | | | | | | Summary: CFA was setup incorrectly, as there is an 8-byte gap at the top of the stack for SP 16-byte alignment purposes. Reviewers: eugenis Reviewed By: eugenis Subscribers: kubamracek, javed.absar, #sanitizers, llvm-commits, pcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60798 llvm-svn: 358535
* [libFuzzer] Remove tautological compare.Matt Morehouse2019-04-161-2/+1
| | | | llvm-svn: 358510
* [TSan][libdispatch] Port gcd-sync-block-copy.mm to C++Julian Lettner2019-04-162-3/+52
| | | | | | | | | | | | | | | | | | | | | | | Summary: Apparently, it makes a difference on where a block lives depending on if it's passed "inline" versus assigned and then passed via a variable. Both tests in this commit now give a signal, if `Block_copy` is used in `dispatch_sync`. Since these tests use different mechanisms (Objective-C retain versus C++ copy constructor) as proxies to observe if the block was copied, we should keep both of them. Commit, that first avoided the unnecessary copy: faef7d034a9ec6cb757137adce8e8670ec6c2d7b Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60639 llvm-svn: 358469
* [libFuzzer] speedup the merge step in the fork mode by merging only the ↵Kostya Serebryany2019-04-132-8/+34
| | | | | | files that have unique features. llvm-svn: 358320
* [libFuzzer] add -features_dir= flag to dump unique input features on diskKostya Serebryany2019-04-1310-6/+60
| | | | llvm-svn: 358317
* [TSan][libdispatch] Move libdispatch tests out of Darwin folderJulian Lettner2019-04-1223-6/+8
| | | | | | | The libdispatch tests are now not tied to Darwin anymore. Move them to their own platform-independent folder. llvm-svn: 358316
* [libFuzzer] Fix DataFlow.cpp logic when tracing long inputs.Max Moroz2019-04-123-11/+29
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: 1. Do not create DFSan labels for the bytes which we do not trace. This is where we run out of labels at the first place. 2. When dumping the traces on the disk, make sure to offset the label identifiers by the number of the first byte in the trace range. 3. For the last label, make sure to write it at the last position of the trace bit string, as that label represents the input size, not any particular byte. Also fixed the bug with division in python which I've introduced when migrated the scripts to Python3 (`//` is required for integral division). Otherwise, the scripts are wasting too much time unsuccessfully trying to collect and process traces from the long inputs. For more context, see https://github.com/google/oss-fuzz/issues/1632#issuecomment-481761789 Reviewers: kcc Reviewed By: kcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60538 llvm-svn: 358311
* [TSan][libdispatch] Don't link against FoundationJulian Lettner2019-04-126-13/+22
| | | | | | | Now that our tests don't depend on Foundation anymore, don't link it in. llvm-svn: 358309
* [TSan][libdispatch] Replace NSTemporaryDirectory in testsJulian Lettner2019-04-126-13/+8
| | | | | | | | | | | | | After this change, most tests don't have a dependency on Foundation. Note: To hold the file name `tempnam` allocates a new buffer. We leak this buffer (omit the free), but I don't think we need to care. Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D60591 llvm-svn: 358308
* [libFuzzer] support -runs=N in the fork mode. Make sure we see one-line ↵Kostya Serebryany2019-04-123-1/+32
| | | | | | reports from ubsan in the fork mode. Test both llvm-svn: 358306
* [TSan][libdispatch] Fix failing testJulian Lettner2019-04-121-0/+1
| | | | | | | | | The ThreadSanitizer-x86_64-iossim configuration (different SDK) seems to require an additional #include. rdar://49856637 llvm-svn: 358300
* [TSan][libdispatch] Delete old testsJulian Lettner2019-04-112-69/+0
| | | | | | | | | | In a previous commit, I re-enabled the ported variants of these 2 tests: tsan/Darwin/gcd-data.mm -> tsan/libdispatch/data.c tsan/Darwin/gcd-source-serial.mm -> tsan/libdispatch/source-serial.c So now we can delete the Darwin-only version. llvm-svn: 358235
* [TSan][libdispatch] Re-enable disabled testsJulian Lettner2019-04-112-6/+0
| | | | | | | | I re-activated "broad strokes suppressions" (ignore_noninstrumented_modules=1) in my last commit. Re-enable tests that only fail on our bots to check if they work now. llvm-svn: 358209
* [TSan][libdispatch] Turn ignore_noninstrumented_modules=1 back on for DarwinJulian Lettner2019-04-111-0/+3
| | | | llvm-svn: 358208
* [libFuzzer] Make MutateWithMask work when the Mask is shorter than the input.Max Moroz2019-04-111-3/+3
| | | | | | | | | | | | | | | | | | | Summary: Before this change, MutateWithMask used to assert that Mask should be of sufficient length (>= Size of the input). However, in real cases we may have inputs that are longer than the Mask they have inherited from the based inputs. Reviewers: kcc, morehouse Reviewed By: kcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60571 llvm-svn: 358207
* [TSan][libdispatch] Replace usage of NSMutableData with stack arrayJulian Lettner2019-04-115-10/+10
| | | | | | | | Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D60477 llvm-svn: 358205
* [TSan][libdispatch] Change test to have two simultaneous timersJulian Lettner2019-04-111-1/+1
| | | | | | | | | | | Change test semantics by waiting for both timer callbacks at the end instead of serializing operations: start/wait timer 1 then 2. Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D60476 llvm-svn: 358204
* [TSan][libdispatch] Replace CFRunLoop with dispatch_semaphore, pt. 2Julian Lettner2019-04-1111-83/+97
| | | | | | | | Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D60475 llvm-svn: 358203
* Revert "tsan: Update test expectations."Matt Morehouse2019-04-111-2/+2
| | | | | | This reverts r357831 to go with r358113. llvm-svn: 358202
* [libFuzzer] Fallback to default Mutate when MutateWithMask fails.Max Moroz2019-04-112-1/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: In case the current corpus input doesn't have bytes going into the focus function, MutateWithMask is useless and may fail gently, allowing the default mutation routine happen, rather than crashing on an assertion. For more context and the initial fix suggestion, see: https://github.com/google/oss-fuzz/issues/1632#issuecomment-481862879 Reviewers: kcc, morehouse Reviewed By: kcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60567 llvm-svn: 358190
OpenPOWER on IntegriCloud