summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* (Reland with changes) Adding a function for setting coverage output file.Sajjad Mirza2019-06-246-13/+168
| | | | | | | | | | | | | | | | | | | | | | | Summary: User code can open a file on its own and pass it to the runtime, rather than specifying a name and having the runtime open the file. This supports the use case where a process cannot open a file on its own but can receive a file descriptor from another process. Relanding https://reviews.llvm.org/D62541. The original revision unlocked the file before calling flush, this revision fixes that. Reviewers: Dor1s, davidxl Reviewed By: Dor1s Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D63581 llvm-svn: 364231
* [ASan] Use dynamic shadow on 32-bit iOS and simulatorsJulian Lettner2019-06-212-31/+23
| | | | | | | | | | | | | | | | | | | | The VM layout on iOS is not stable between releases. On 64-bit iOS and its derivatives we use a dynamic shadow offset that enables ASan to search for a valid location for the shadow heap on process launch rather than hardcode it. This commit extends that approach for 32-bit iOS plus derivatives and their simulators. rdar://50645192 rdar://51200372 rdar://51767702 Reviewed By: delcypher Differential Revision: https://reviews.llvm.org/D63586 llvm-svn: 364105
* [asan] Quote the path to the Python exe in case it has spacesReid Kleckner2019-06-211-2/+10
| | | | | | | | | | | | | These days, Python 3 installs itself into Program Files, so it often has spaces. At first, I resisted this, and I reinstalled it globally into C:/Python37, similar to the location used for Python 2.7. But then I updated VS 2019, and it uninstalled my copy of Python and installed a new one inside "C:/Program Files (x86)/Microsoft Visual Studio/". At this point, I gave up and switched to using its built-in version of Python. However, now these tests fail, and have to be made aware of the possibility of spaces in paths. :( llvm-svn: 364077
* [asan] Avoid two compiler-synthesized calls to memset & memcpyReid Kleckner2019-06-212-5/+5
| | | | | | | | | | Otherwise the tests hang on Windows attempting to report nested errors. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D63627 llvm-svn: 364070
* [libFuzzer] split DataFlow.cpp into two .cpp files, one of which can be ↵Kostya Serebryany2019-06-216-104/+154
| | | | | | compiled w/o dfsan to speed things up (~25% speedup) llvm-svn: 364002
* [libFuzzer] ensure that DFT and autofocus works for C++ (mangled) functionsKostya Serebryany2019-06-203-6/+13
| | | | llvm-svn: 363905
* Specify log level for CMake messages (less stderr)Stefan Granitz2019-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Specify message levels in CMake. Prefer STATUS (stdout). As the default message mode (i.e. level) is NOTICE in CMake, more then necessary messages get printed to stderr. Some tools, noticably ccmake treat this as an error and require additional confirmation and re-running CMake's configuration step. This commit specifies a mode (either STATUS or WARNING or FATAL_ERROR) instead of the default. * I used `csearch -f 'llvm-project/.+(CMakeLists\.txt|cmake)' -l 'message\("'` to find all locations. * Reviewers were chosen by the most common authors of specific files. If there are more suitable reviewers for these CMake changes, please let me know. Patch by: Christoph Siedentop Reviewers: zturner, beanz, xiaobai, kbobyrev, lebedev.ri, sgraenitz Reviewed By: sgraenitz Subscribers: mgorny, lebedev.ri, #sanitizers, lldb-commits, llvm-commits Tags: #sanitizers, #lldb, #llvm Differential Revision: https://reviews.llvm.org/D63370 llvm-svn: 363821
* [libFuzzer] Remove too aggressive static_assert in FuzzedDataProvider.Max Moroz2019-06-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/31 error: static_assert failed due to requirement 'std::numeric_limits<char>::is_signed' "Destination type must be signed." static_assert(std::numeric_limits<TS>::is_signed, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/buildslave/buildslave/clang-cmake-aarch64-full/llvm/projects/compiler-rt/lib/fuzzer/utils/FuzzedDataProvider.h:126:19: note: in instantiation of function template specialization 'FuzzedDataProvider::ConvertUnsignedToSigned<char, unsigned char>' requested here char next = ConvertUnsignedToSigned<char>(data_ptr_[0]); ^ 1 error generated. Reviewers: Dor1s Reviewed By: Dor1s Subscribers: javed.absar, kristof.beyls, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63553 llvm-svn: 363805
* Revert r363633 "[CMake] Fix the value of `config.target_cflags` for ↵Hans Wennborg2019-06-195-97/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-macOS Apple platforms. Attempt #2." This caused Chromium's clang package to stop building, see comment on https://reviews.llvm.org/D61242 for details. > Summary: > The main problem here is that `-*-version_min=` was not being passed to > the compiler when building test cases. This can cause problems when > testing on devices running older OSs because Clang would previously > assume the minimum deployment target is the the latest OS in the SDK > which could be much newer than what the device is running. > > Previously the generated value looked like this: > > `-arch arm64 -isysroot > <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` > > With this change it now looks like: > > `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot > <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` > > This mirrors the setting of `config.target_cflags` on macOS. > > This change is made for ASan, LibFuzzer, TSan, and UBSan. > > To implement this a new `get_test_cflags_for_apple_platform()` function > has been added that when given an Apple platform name and architecture > returns a string containing the C compiler flags to use when building > tests. This also calls a new helper function `is_valid_apple_platform()` > that validates Apple platform names. > > This is the second attempt at landing the patch. The first attempt (r359305) > had to be reverted (r359327) due to a buildbot failure. The problem was > that calling `get_test_cflags_for_apple_platform()` can trigger a CMake > error if the provided architecture is not supported by the current > CMake configuration. Previously, this could be triggered by passing > `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were > generating test configurations for a list of architectures without > checking if the relevant Sanitizer actually supported that architecture. > We now intersect the list of architectures for an Apple platform > with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer > name) to iterate through the correct list of architectures. > > rdar://problem/50124489 > > Reviewers: kubamracek, yln, vsk, juliehockett, phosek > > Subscribers: mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits > > Tags: #llvm, #sanitizers > > Differential Revision: https://reviews.llvm.org/D61242 llvm-svn: 363779
* [Sanitizers] Fix sanitizer_posix_libcdep.cc compilation on Solaris 11.5Rainer Orth2019-06-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent build of Solaris 11.5 Beta (st_047) gained madvise(MADV_DONTDUMP) support for Linux compatibility. This broke the compiler-rt build: /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_comm/sanitizer_posix_libcdep.cc: In function ‘bool __sanitizer::DontDumpShadowMemory(__sanitizer::uptr, __sanitizer::uptr)’: /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc:81:18: error: invalid conversion from ‘void*’ to ‘caddr_t’ {aka ‘char*’} [-fpermissive] 81 | return madvise((void *)addr, length, MADV_DONTDUMP) == 0; | ^~~~~~~~~~~~ | | | void* In file included from /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc:32: /usr/include/sys/mman.h:231:20: note: initializing argument 1 of ‘int madvise(caddr_t, std::size_t, int)’ 231 | extern int madvise(caddr_t, size_t, int); | ^~~~~~~ The obvious fix is to use the same solution that has already been used a couple of lines earlier: // In the default Solaris compilation environment, madvise() is declared // to take a caddr_t arg; casting it to void * results in an invalid // conversion error, so use char * instead. This allowed the compiler-rt build to finish and was tested successfully on i386-pc-solaris2.11 and x86_64-pc-linux-gnu. Differential Revision: https://reviews.llvm.org/D62892 llvm-svn: 363778
* Don't crash if PR_SET_VMA_ANON_NAME fails.Evgeniy Stepanov2019-06-181-2/+1
| | | | | | | | This prctl is not implemented on very old devices. It is not necessary for the core functionality of the tool. Simply ignore the failure. llvm-svn: 363755
* [libFuzzer] Improve FuzzedDataProvider helper.Max Moroz2019-06-182-65/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The following changes are made based on the feedback from Tim King: - Removed default template parameters, to have less assumptions. - Implemented `ConsumeBytesWithTerminator` method. - Made `PickValueInArray` method work with `initializer_list` argument. - Got rid of `data_type` type alias, that was redundant. - Refactored `ConsumeBytes` logic into a private method for better code reuse. - Replaced implementation defined unsigned to signed conversion. - Fixed `ConsumeRandomLengthString` to always call `shrink_to_fit`. - Clarified and fixed some commments. - Applied clang-format to both the library and the unittest source. Tested on Linux, Mac, Windows. Reviewers: morehouse, metzman Reviewed By: morehouse Subscribers: delcypher, #sanitizers, llvm-commits, kcc Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63348 llvm-svn: 363735
* [scudo][standalone] Fuchsia related changesKostya Kortchinsky2019-06-183-38/+37
| | | | | | | | | | | | | | | | | | | | | | Summary: Fuchsia wants to use mutexes with PI in the Scudo code, as opposed to our own implementation. This required making `lock` & `unlock` platform specific (as opposed to `wait` & `wake`) [code courtesy of John Grossman]. There is an additional flag required now for mappings as well: `ZX_VM_ALLOW_FAULTS`. Reviewers: morehouse, mcgrathr, eugenis, vitalybuka, hctim Reviewed By: morehouse Subscribers: delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63435 llvm-svn: 363705
* [compiler-rt][SystemZ] Work around ASAN failures via -fno-partial-inliningUlrich Weigand2019-06-182-0/+10
| | | | | | | | | | | | | | | | | Since updating the SystemZ LLVM build bot system to Ubuntu 18.04, all bots are red due to two ASAN failures. It turns out these are triggered due to building the ASAN support libraries, in particular the interceptor routines using GCC 7. Specifically, at least on our platform, this compiler decides to "partially inline" some of those interceptors, creating intermediate stub routines like "__interceptor_recvfrom.part.321". These will show up in the backtraces at interception points, causing testsuite failures. As a workaround to get the build bots green again, this patch adds the -fno-partial-inlining command line option when building the common sanitizer support libraries on s390x, if that option is supported by the compiler. llvm-svn: 363679
* Disable recently added Darwin symbolization tests for iOS.Dan Liew2019-06-182-0/+2
| | | | | | | | These tests won't necessarily work because the reported modules paths from the device don't match what's on the host and so offline symbolization fails. llvm-svn: 363641
* [NFC] Split `Darwin/asan-symbolize-partial-report-with-module-map.cc`.Dan Liew2019-06-182-20/+42
| | | | | | | Split `Darwin/asan-symbolize-partial-report-with-module-map.cc` into two separate test cases due to them testing slightly different things. llvm-svn: 363640
* [asan_symbolize] Teach `asan_symbolize.py` to symbolicate partially ↵Dan Liew2019-06-182-2/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | symbolicated ASan reports. Summary: The use case here is to be able symbolicate ASan reports that might be partially symbolicated, in particular where the function name is known but no source location is available. This can be caused by missing debug info. Previously we would only try to symbolicate completely unsymbolicated reports. The code currently contains an unfortunate quirk to handle a darwin specific bug (rdar://problem/49784442) in the way partially symbolicated reports are emitted when the source location is missing. rdar://problem/49476995 Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka Subscribers: aprantl, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60533 llvm-svn: 363639
* hwasan: Use bits [3..11) of the ring buffer entry address as the base stack tag.Peter Collingbourne2019-06-174-13/+21
| | | | | | | | | | | | | | This saves roughly 32 bytes of instructions per function with stack objects and causes us to preserve enough information that we can recover the original tags of all stack variables. Now that stack tags are deterministic, we no longer need to pass -hwasan-generate-tags-with-calls during check-hwasan. This also means that the new stack tag generation mechanism is exercised by check-hwasan. Differential Revision: https://reviews.llvm.org/D63360 llvm-svn: 363636
* [CMake] Fix the value of `config.target_cflags` for non-macOS Apple ↵Dan Liew2019-06-175-35/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platforms. Attempt #2. Summary: The main problem here is that `-*-version_min=` was not being passed to the compiler when building test cases. This can cause problems when testing on devices running older OSs because Clang would previously assume the minimum deployment target is the the latest OS in the SDK which could be much newer than what the device is running. Previously the generated value looked like this: `-arch arm64 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` With this change it now looks like: `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` This mirrors the setting of `config.target_cflags` on macOS. This change is made for ASan, LibFuzzer, TSan, and UBSan. To implement this a new `get_test_cflags_for_apple_platform()` function has been added that when given an Apple platform name and architecture returns a string containing the C compiler flags to use when building tests. This also calls a new helper function `is_valid_apple_platform()` that validates Apple platform names. This is the second attempt at landing the patch. The first attempt (r359305) had to be reverted (r359327) due to a buildbot failure. The problem was that calling `get_test_cflags_for_apple_platform()` can trigger a CMake error if the provided architecture is not supported by the current CMake configuration. Previously, this could be triggered by passing `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were generating test configurations for a list of architectures without checking if the relevant Sanitizer actually supported that architecture. We now intersect the list of architectures for an Apple platform with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer name) to iterate through the correct list of architectures. rdar://problem/50124489 Reviewers: kubamracek, yln, vsk, juliehockett, phosek Subscribers: mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D61242 llvm-svn: 363633
* [GWP-ASan] Disable GWP-ASan on Android for now.Mitch Phillips2019-06-172-2/+5
| | | | | | | | | | | | | | | | | | | Summary: Temporarily disable GWP-ASan for android until the bugs at: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/87 ... can be fixed. See comments for the full bug trace. Reviewers: eugenis Reviewed By: eugenis Subscribers: srhines, kubamracek, mgorny, cryptoad, jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D63460 llvm-svn: 363624
* Stop counting pops in tsan/check_analyze.sh.Evgeniy Stepanov2019-06-171-2/+0
| | | | | | | | | | | | | | | | | Summary: It looks like LLVM has started doing less tail duplication in this code, or something like that, resulting in a significantly smaller number of pop instructions (16 -> 12). Removing the check. Reviewers: vitalybuka, dvyukov Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D63450 llvm-svn: 363615
* Attempt to fix GWP-ASan build failure on sanitizer-android. Add -fPIC.Mitch Phillips2019-06-171-1/+1
| | | | llvm-svn: 363604
* [GWP-ASan] Integration with Scudo [5].Mitch Phillips2019-06-1721-5/+335
| | | | | | | | | | | | | | | | | | | | | | Summary: See D60593 for further information. This patch adds GWP-ASan support to the Scudo hardened allocator. It also implements end-to-end integration tests using Scudo as the backing allocator. The tests include crash handling for buffer over/underflow as well as use-after-free detection. Reviewers: vlad.tsyrklevich, cryptoad Reviewed By: vlad.tsyrklevich, cryptoad Subscribers: kubamracek, mgorny, #sanitizers, llvm-commits, morehouse Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D62929 llvm-svn: 363584
* [scudo][standalone] Introduce the combined allocatorKostya Kortchinsky2019-06-175-0/+870
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The Combined allocator hold together all the other components, and provides a memory allocator interface based on various template parameters. This will be in turn used by "wrappers" that will provide the standard C and C++ memory allocation functions, but can be used as is as well. This doesn't depart significantly from the current Scudo implementation except for a few details: - Quarantine batches are now protected by a header a well; - an Allocator instance has its own TSD registry, as opposed to a static one for everybody; - a function to iterate over busy chunks has been added, for Android purposes; This also adds the associated tests, and a few default configurations for several platforms, that will likely be further tuned later on. Reviewers: morehouse, hctim, eugenis, vitalybuka Reviewed By: morehouse Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63231 llvm-svn: 363569
* [compiler-rt] Respect CMAKE_NMShoaib Meenai2019-06-152-5/+12
| | | | | | | | | | | The default nm executable may not be able to handle the architecture we're building the sanitizers for. Respect CMAKE_NM if it's set to ensure we're using the correct nm tool. Preserve the existing NM environment variable override to not break its users. Differential Revision: https://reviews.llvm.org/D63368 llvm-svn: 363483
* Improve error message when '=' is missing in {ASAN,...}_OPTIONS.Vitaly Buka2019-06-1516-38/+49
| | | | | | | | | | | | | | | | | | Summary: It's handling isses as described here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89832 Patch by Martin Liška. Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: cryptoad, kubamracek Differential Revision: https://reviews.llvm.org/D59876 llvm-svn: 363480
* [libFuzzer] in autofocus mode, give more weight to functions with DFTKostya Serebryany2019-06-143-5/+21
| | | | llvm-svn: 363473
* [libFuzzer] implement a better queue for the fork mode. Add an internal flag ↵Kostya Serebryany2019-06-146-35/+58
| | | | | | -stop_file to allow graceful shutdown of fuzzing. Enhance the logging in the fork mode llvm-svn: 363470
* [libFuzzer] fix -Werror buildKostya Serebryany2019-06-141-1/+1
| | | | llvm-svn: 363469
* [libFuzzer] simplify the DFT trace collection using the new faster DFSan ↵Kostya Serebryany2019-06-146-184/+172
| | | | | | mode that traces up to 16 labels at a time and never runs out of labels. Second attempt. This time with a fix for windows (putenv instead of setenv)) llvm-svn: 363445
* [libFuzzer] Disable len_control by default if LLVMFuzzerCustomMutator is used.Max Moroz2019-06-143-3/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: Some custom mutators may not peform well when size restriction is enforced by len_control. Because of that, it's safer to disable len_control by default in such cases, but still allow users to enable it manually. Bug example: https://bugs.chromium.org/p/chromium/issues/detail?id=919530. Tested manually with LPM-based and regular fuzz targets. Reviewers: kcc, vitalybuka, metzman Reviewed By: kcc, metzman Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63334 llvm-svn: 363443
* Revert r363326 "[libFuzzer] simplify the DFT trace collection using the new ↵Hans Wennborg2019-06-146-171/+184
| | | | | | | | | | | | faster DFSan mode that traces up to 16 labels at a time and never runs out of labels." It broke the Windows build: C:\b\s\w\ir\cache\builder\src\third_party\llvm\compiler-rt\lib\fuzzer\FuzzerDataFlowTrace.cpp(243): error C3861: 'setenv': identifier not found This also reverts the follow-up r363327. llvm-svn: 363358
* fix whitespacesKostya Serebryany2019-06-131-3/+1
| | | | llvm-svn: 363327
* [libFuzzer] simplify the DFT trace collection using the new faster DFSan ↵Kostya Serebryany2019-06-136-184/+173
| | | | | | mode that traces up to 16 labels at a time and never runs out of labels. llvm-svn: 363326
* [dfsan] Introduce dfsan_flush().Kostya Serebryany2019-06-134-0/+42
| | | | | | | | | | | | | | | | | | | Summary: dfsan_flush() allows to restart tain tracking from scratch in the same process. The primary purpose right now is to allow more efficient data flow tracing for DFT fuzzing: https://github.com/google/oss-fuzz/issues/1632 Reviewers: pcc Reviewed By: pcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63037 llvm-svn: 363321
* [compiler-rt] Fix name_to_handle_at.cc test on Overlay2 (for Docker)Amy Kwan2019-06-121-1/+1
| | | | | | | | | | | | | This patch aims to fix the test case, name_to_handle_at.cc that fails on Docker. Overlay2 on Docker does not support the current check for the name_to_handle_at() function call of the test case. The proposed fix is to check for /dev/null in the test instead, as this check is supported. Checking for /dev/null has been utilized in the past for other test cases, as well. Differential Revision: https://reviews.llvm.org/D63094 llvm-svn: 363167
* Revert r362676 "[Profile]: Add runtime interface to specify file handle for ↵Hans Wennborg2019-06-126-168/+13
| | | | | | | | | | | | | | | profile data." This caused instrumented Clang to become crashy. See llvm-commits thread for repro steps. This also reverts follow-up r362716 which added test cases. > Author: Sajjad Mirza > > Differential Revision: http://reviews.llvm.org/D62541 llvm-svn: 363134
* [Sanitizers] Add case MACOS_VERSION_CATALINAJulian Lettner2019-06-112-2/+3
| | | | | | | | Reviewed By: delcypher Differential Revision: https://reviews.llvm.org/D63096 llvm-svn: 363104
* [scudo][standalone] Unmap memory in testsKostya Kortchinsky2019-06-118-16/+74
| | | | | | | | | | | | | | | | | | | | | Summary: The more tests are added, the more we are limited by the size of the address space on 32-bit. Implement `unmapTestOnly` all around (like it is in sanitzer_common) to be able to free up some memory. This is not intended to be a proper "destructor" for an allocator, but allows us to not fail due to having no memory left. Reviewers: morehouse, vitalybuka, eugenis, hctim Reviewed By: morehouse Subscribers: delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63146 llvm-svn: 363095
* Add FuzzedDataProvider helper class / single header library.Max Moroz2019-06-114-2/+544
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This class is useful for writing fuzz target that have multiple inputs. Current CL imports the existing `FuzzedDataProvider` from Chromium without any modifications. Feel free to review it thoroughly, if you're interested, but I'd prefer changing the class in a follow up CL. The CL also introduces an exhaustive test for the library, as the behavior of `FuzzedDataProvider` must not change over time. In follow up CLs I'm planning on changing some implementation details (I can share a doc with some comments to be addressed). After that, we will document how `FuzzedDataProvider` should be used. I have tested this on Linux, Windows and Mac platforms. Reviewers: morehouse, metzman, kcc Reviewed By: morehouse Subscribers: metzman, thakis, rnk, mgorny, ormris, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62733 llvm-svn: 363071
* [compiler-rt] Update comments in asan header to doxygen format; NFC.Pierre Gousseau2019-06-112-295/+609
| | | | | | | | | | | | | Add description to undocumented functions. Improve spelling, grammar and formatting. Patch by: Craig Flores, Filipe Cabecinhas, Pierre Gousseau Reviewed By: Johannes Doerfert Differential Revision: https://reviews.llvm.org/D62245 llvm-svn: 363038
* Add unused symbol to thunk files to force wholearchive inclusionReid Kleckner2019-06-102-0/+12
| | | | | | | | | | | | | | These "dynamic_runtime_thunk" object files exist to create a weak alias from 'foo' to 'foo_dll' for all weak sanitizer runtime symbols. The weak aliases are implemented as /alternatename linker options in the .drective section, so they are not actually in the symbol table. In order to force the Visual C++ linker to load the object, even with -wholearchive:, we have to provide at least one external symbol. Once we do that, it will read the .drective sections and see the weak aliases. Fixes PR42074 llvm-svn: 362970
* [scudo][standalone] Introduce the thread specific data structuresKostya Kortchinsky2019-06-1010-11/+512
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This CL adds the structures dealing with thread specific data for the allocator. This includes the thread specific data structure itself and two registries for said structures: an exclusive one, where each thread will have its own TSD struct, and a shared one, where a pool of TSD structs will be shared by all threads, with dynamic reassignment at runtime based on contention. This departs from the current Scudo implementation: we intend to make the Registry a template parameter of the allocator (as opposed to a single global entity), allowing various allocators to coexist with different TSD registry models. As a result, TSD registry and Allocator are tightly coupled. This also corrects a couple of things in other files that I noticed while adding this. Reviewers: eugenis, vitalybuka, morehouse, hctim Reviewed By: morehouse Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62258 llvm-svn: 362962
* Experimantal dfsan mode "fast16labels=1"Kostya Serebryany2019-06-083-0/+31
| | | | | | | | | | | | | | | | | | Summary: dfsan mode "fast16labels=1". In this mode the labels are treated as 16-bit bit masks. Reviewers: pcc Reviewed By: pcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62870 llvm-svn: 362859
* [GWP-ASan] Removed unittests from Android build.Mitch Phillips2019-06-071-1/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: Longstanding issues in the Android test runner means that compiler-rt unit tests don't work on Android due to libc++ link-time issues. Looks like the exported libc++ from the Android NDK is x86-64, even though it's part of the ARM[64] toolchain... See similar measures for ASan and sanitizer-common that disable unit tests for Android. Should fully fix the Android bots (@vlad.tsyrklevich). Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits, vlad.tsyrklevich Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D63019 llvm-svn: 362842
* Set an output file name for the override-new-delete.cpp test.Peter Collingbourne2019-06-071-1/+1
| | | | | | The android_compile.py script requires one. llvm-svn: 362764
* Change GWP-ASan build to use '-pthread' instead of '-lpthread' in orderMitch Phillips2019-06-062-2/+2
| | | | | | | | to try and fix android buildbot. Also make sure that the empty dummy test contains an output file name so the android_build.py wrapper script doesn't check fail. llvm-svn: 362758
* [Profile]: Add runtime interface to specify file handle for profile data ↵Xinliang David Li2019-06-062-0/+74
| | | | | | | | | | | | (Part-II) Test cases Author: Sajjad Mirza Differential Revision: http://reviews.llvm.org/D62541 llvm-svn: 362716
* Fixup files added in r362636 to build with gcc 5.4. NFCIDouglas Yung2019-06-062-13/+13
| | | | llvm-svn: 362682
* [Profile]: Add runtime interface to specify file handle for profile data.Xinliang David Li2019-06-064-13/+94
| | | | | | | | Author: Sajjad Mirza Differential Revision: http://reviews.llvm.org/D62541 llvm-svn: 362676
OpenPOWER on IntegriCloud