summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [XRay][compiler-rt] Remove __sanitizer:: from namespace __xray (NFC)Dean Michael Berris2018-06-0511-189/+163
| | | | | | | This is a non-functional change that removes the full qualification of functions in __sanitizer:: being used in __xray. llvm-svn: 333983
* [XRay][compiler-rt] Remove reliance on C++ ABI from BufferQueueDean Michael Berris2018-06-052-6/+31
| | | | | | | | | | | | | | | | | Summary: This is part of the work to address http://llvm.org/PR32274. We remove the calls to array-placement-new and array-delete. This allows us to rely on the internal memory management provided by sanitizer_common/sanitizer_internal_allocator.h. Reviewers: eizan, kpw Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47695 llvm-svn: 333982
* [TSan] FreeBSD / intercept thr_exitDavid Carlier2018-06-041-0/+12
| | | | | | | | | | | | | | | intercepting thr_exit to terminate threads under FreeBSD. Unblock few unit tests hanging. Reviewers: krytarowski, vitalybuka, emaste Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D47677 M lib/tsan/rtl/tsan_interceptors.cc llvm-svn: 333870
* [XRay][compiler-rt] Remove RTTI requirement from XRay BuildsDean Michael Berris2018-06-041-0/+4
| | | | | | | | | XRay doesn't use RTTI and doesn't need it. We disable it explicitly in the CMake config, similar to how the other sanitizers already do it. Part of the work to address http://llvm.org/PR32274. llvm-svn: 333867
* [Fuzzer] Migrate Fuchsia port from launchpad to fdio_spawnPetr Hosek2018-06-021-19/+36
| | | | | | | | fdio_spawn is the new public API for launching processes in Fuchsia. Differential Revision: https://reviews.llvm.org/D47649 llvm-svn: 333809
* Add weak definitions of trace-cmp hooks to dfsanKostya Serebryany2018-06-012-1/+25
| | | | | | | | | | | | | | | | | | | | | Summary: This allows to build and link the code with e.g. -fsanitize=dataflow -fsanitize-coverage=trace-pc-guard,pc-table,func,trace-cmp w/o providing (all) the definitions of trace-cmp hooks. This is similar to dummy hooks provided by asan/ubsan/msan for the same purpose, except that some of the hooks need to have the __dfsw_ prefix since we need dfsan to replace them. Reviewers: pcc Reviewed By: pcc Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47605 llvm-svn: 333796
* [asan, myriad] Implement aligned local pool allocationWalter Lee2018-06-011-1/+25
| | | | | | | | Extend the local pool allocation support to posix_memalign. Differential Revision: https://reviews.llvm.org/D47642 llvm-svn: 333788
* [asan, myriad] Configure platform interceptorsWalter Lee2018-06-012-5/+16
| | | | | | | | | | | Myriad only uses the platform interceptors for memory allocation routines. Configure them properly. Also add a missing guard around aligned alloc interceptor. Differential Revision: https://reviews.llvm.org/D47641 llvm-svn: 333784
* Fix GCC 4.8.5 build by avoiding braced default member initializerReid Kleckner2018-05-311-1/+8
| | | | | | Use internal_memset instead. Should revive all Linux Chromium ToT bots. llvm-svn: 333678
* Define SIZEOF_STRUCT_USTAT for 32bit sparc.Sylvestre Ledru2018-05-311-1/+1
| | | | | | | | Patch landed on gcc upstream: https://github.com/gcc-mirror/gcc/commit/27453e962b3fe2f918c5105b2a48ec3e92d4c873 Patch by Matthias Klose llvm-svn: 333644
* Missing includeStephan Bergmann2018-05-311-0/+1
| | | | | | | (For some reason, my Mac build complained about unknown pthread_once_t and PTHREAD_ONCE_INIT, but not about pthread_once itself.) llvm-svn: 333638
* [XRay] Fixup: Remove unnecessary type aliasDean Michael Berris2018-05-311-6/+4
| | | | | | Follow-up to D45758. llvm-svn: 333628
* [XRay] Fixup: Explicitly call std::make_tuple(...)Dean Michael Berris2018-05-311-2/+2
| | | | | | Follow-up to D45758. llvm-svn: 333627
* [XRay] Fixup: Address some warnings breaking buildDean Michael Berris2018-05-312-7/+7
| | | | | | Follow-up to D45758. llvm-svn: 333625
* [XRay][profiler] Part 3: Profile Collector ServiceDean Michael Berris2018-05-316-0/+556
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is part of the larger XRay Profiling Mode effort. This patch implements a centralised collector for `FunctionCallTrie` instances, associated per thread. It maintains a global set of trie instances which can be retrieved through the XRay API for processing in-memory buffers (when registered). Future changes will include the wiring to implement the actual profiling mode implementation. This central service provides the following functionality: * Posting a `FunctionCallTrie` associated with a thread, to the central list of tries. * Serializing all the posted `FunctionCallTrie` instances into in-memory buffers. * Resetting the global state of the serialized buffers and tries. Depends on D45757. Reviewers: echristo, pelikan, kpw Reviewed By: kpw Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D45758 llvm-svn: 333624
* [libFuzzer] add collect_data_flow.py that allows to run the data-flow tracer ↵Kostya Serebryany2018-05-311-0/+56
| | | | | | several times on subsets of inputs bytes, to overcome DFSan out-of-label failures llvm-svn: 333616
* [asan] Remove unneeded VirtualQuery from exception handlerReid Kleckner2018-05-301-5/+0
| | | | | | | | We don't use the result of the query, and all tests pass if I remove it. During startup, ASan spends a fair amount of time in this handler, and the query is much more expensive than the call to commit the memory. llvm-svn: 333595
* [asan, myriad] Simplify main thread handlingWalter Lee2018-05-303-40/+10
| | | | | | | | | | On Myriad RTEMS, we don't need to treat the main thread differently. The existing thread hooks will do the right thing, so get rid of all the unneeded special logic. Differential Revision: https://reviews.llvm.org/D47502 llvm-svn: 333504
* [asan, myriad] Reset shadow memory during exitWalter Lee2018-05-301-14/+17
| | | | | | | | | Reset shadow memory during exit. Also update a cut-and-paste comment, and do some minor refactoring of InitializeShadowMemory. Differential Revision: https://reviews.llvm.org/D47501 llvm-svn: 333503
* [safestack] Lazy initialization of interceptorsVitaly Buka2018-05-261-4/+16
| | | | | | | | | Interceptors initialization may try to allocate memory and to call not initialized allocator. It's similar to r326025 for CFI. llvm-svn: 333329
* [Fuzzer] Update _zx_port_wait function use in Fuchsia portPetr Hosek2018-05-261-5/+5
| | | | | | | | | Fuchsia's _zx_port_wait no longer takes the count argument. This change also updates all symbol uses to use the underscored versions. Differential Revision: https://reviews.llvm.org/D47403 llvm-svn: 333328
* Revert the last test commitH.J. Lu2018-05-251-1/+0
| | | | llvm-svn: 333310
* This is a test commit to verify repository accessH.J. Lu2018-05-251-0/+1
| | | | llvm-svn: 333309
* [libFuzzer] Run libFuzzer unit tests only on host architecture.George Karpenkov2018-05-241-32/+33
| | | | | | | | | | LIT tests are used to test other cross-compiled architectures, unit tests are only run on the host. NFC now as currently only a single architecture is supported. Differential Revision: https://reviews.llvm.org/D47286 llvm-svn: 333241
* Revert "[cmake] [ARM] Check if VFP is supported before including any VFP ↵Azharuddin Mohammed2018-05-241-14/+5
| | | | | | | | builtins" This reverts commit 2a10f5da5acb1b51d0a2ecf13dca0bf1de859db2. llvm-svn: 333232
* [cmake] [ARM] Check if VFP is supported before including any VFP builtinsAzharuddin Mohammed2018-05-241-5/+14
| | | | | | | | | | | | | | | | | | | Summary: rL325492 disables FPU features when using soft floating point (-mfloat-abi=soft), which is used internally when building for armv7. This causes errors with builtins that utililize VFP instructions. With this change we first check if VFP is enabled (by checking if the preprocessor macro __VFP_FP__ is defined) before including such builtins. Reviewers: rengolin, samsonov, compnerd, smeenai, javed.absar, peter.smith Reviewed By: peter.smith Subscribers: peter.smith, mgorny, kristof.beyls, chrib, llvm-commits Differential Revision: https://reviews.llvm.org/D47217 llvm-svn: 333216
* sanitizer: Use pre-computed size of struct ustat for LinuxCraig Topper2018-05-241-2/+13
| | | | | | | | | | | | | | | | | | | <sys/ustat.h> has been removed from glibc 2.28 by: commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Sun Mar 18 11:28:59 2018 +0800 Deprecate ustat syscall interface This patch uses pre-computed size of struct ustat for Linux to fix https://bugs.llvm.org/show_bug.cgi?id=37418 Patch by H.J. Lu. Differential Revision: https://reviews.llvm.org/D47281 llvm-svn: 333213
* [libFuzzer] DataFlow tracer now tags a subset of the input. A separate ↵Kostya Serebryany2018-05-242-6/+47
| | | | | | script merges traces from the subsets llvm-svn: 333149
* [libFuzzer] fix two off-by-ones (!!) in the data flow tracerKostya Serebryany2018-05-231-2/+3
| | | | llvm-svn: 333142
* [fuchsia] Add line buffering in RawWriteJake Ehrlich2018-05-231-1/+25
| | | | | | | | This change causes RawWrite to buffer upto 128 bytes or until a line is reached. This helps group calls into more readable lines. llvm-svn: 333136
* [libFuzzer] change the output format for the DataFlow tracerKostya Serebryany2018-05-231-23/+25
| | | | llvm-svn: 333122
* [libFuzzer] Don't complain about lack of interesting inputs when -runs=0.Max Moroz2018-05-231-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The most common usecase for -runs=0 is for generating code coverage over some corpus. Coverage reports based on sancov are about to be deprecated, which means some external coverage solution will be used, e.g. Clang source based code coverage, which does not use any sancov instrumentations and thus libFuzzer would consider any input to be not interesting in that case. Reviewers: kcc Reviewed By: kcc Subscribers: alex, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47271 llvm-svn: 333116
* [sanitizer] Define UINTPTR_MAXKostya Kortchinsky2018-05-231-0/+6
| | | | | | | | | | | | | | | | Summary: `sanitizer_internal_defs.h` didn't have this define, which will be useful in an upcoming CL. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D47270 llvm-svn: 333109
* Fix internal_mmap() on 32-bit NetBSD platformsKamil Rytarowski2018-05-231-1/+1
| | | | | | | There is need to use internal_syscall64() instead of internal_syscall_ptr(). The offset argument of type off_t is always 64-bit. llvm-svn: 333075
* [sanitizer] Reland "Be more accurate when calculating the previous ↵Igor Kudrin2018-05-232-5/+7
| | | | | | | | instruction address on ARM." Differential Revision: https://reviews.llvm.org/D46004 llvm-svn: 333071
* [libFuzzer] modify -print_corpus_stats to print whether the input reaches ↵Kostya Serebryany2018-05-231-2/+2
| | | | | | the focus function llvm-svn: 333048
* [asan] Use dynamic allocator space address on Android/AArch64.Evgeniy Stepanov2018-05-221-1/+2
| | | | | | | | | | | | | | Summary: We need one library to support all of 39, 42 and 48 bit VMAs, and there is no common address that works for all of them. Reviewers: kcc, alekseyshl, javed.absar Subscribers: rengolin, srhines, kubamracek, kristof.beyls, llvm-commits, cryptoad Differential Revision: https://reviews.llvm.org/D47160 llvm-svn: 333025
* [asan] Make GetCurrentThread RTEMS-friendlyWalter Lee2018-05-212-0/+6
| | | | | | | | | | | | | | | | | On RTEMS, system and user code all live in a single binary and address space. There is no clean separation, and instrumented code may execute before the ASan run-time is initialized (or after it has been destroyed). Currently, GetCurrentThread() may crash if it's called before ASan run-time is initialized. Make it return nullptr instead. Similarly, fix __asan_handle_no_return so that it gives up rather than try something that may crash. Differential Revision: https://reviews.llvm.org/D46459 llvm-svn: 332888
* [libFuzzer] reinstate -dump_coverage, which is still in use (reverts r332036)Kostya Serebryany2018-05-216-1/+17
| | | | llvm-svn: 332876
* Align ClearShadowForThreadStackAndTLS for NetBSD/i386Kamil Rytarowski2018-05-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The static TLS vector for the main thread on NetBSD/i386 can be unaligned in terms of the shadow granularity. Align the start of it with Round Down and end of it with Round Up operations for the shadow granularity shift. Example static TLS vector ranges on NetBSD/i386: tls_begin_=0xfbee7244 tls_end_=0xfbee726c. ClearShadowForThreadStackAndTLS() is called from the Main Thread bootstrap functions. This change restores the NetBSD x86 32-bit (i386) support. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D46585 llvm-svn: 332792
* Port msan_test.cc to NetBSDKamil Rytarowski2018-05-191-61/+76
| | | | | | | | | | | | | | | | | | | | | Summary: The changes allows building this file on NetBSD, mostly by disabling the unsupported functions and adding OS-specific system includes. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D46712 llvm-svn: 332791
* [msan] Don't check divisor shadow in fdiv.Evgeniy Stepanov2018-05-181-1/+0
| | | | | | | | | | | | | | | | Summary: Floating point division by zero or even undef does not have undefined behavior and may occur due to optimizations. Fixes https://bugs.llvm.org/show_bug.cgi?id=37523. Reviewers: kcc Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D47085 llvm-svn: 332761
* [asan] Explicitly declare memintrinsics interceptors to have C linkageWalter Lee2018-05-181-6/+6
| | | | | | | | This is needed on RTEMS. Also update a comment. Differential Revision: https://reviews.llvm.org/D47079 llvm-svn: 332746
* [asan] Remove an unsigned compare >= 0Walter Lee2018-05-181-1/+1
| | | | | | | | | This is not needed after we've forked the Myriad version. Not to mention it produces a compiler warning. Differential Revision: https://reviews.llvm.org/D47054 llvm-svn: 332744
* [asan] Add target-specific files for Myriad RTEMS portWalter Lee2018-05-185-0/+582
| | | | | | Differential Revision: https://reviews.llvm.org/D46468 llvm-svn: 332691
* [asan] Add support for Myriad RTEMS memory mapWalter Lee2018-05-184-52/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Myriad RTEMS memory system has a few unique aspects that require support in the ASan run-time. - A limited amount of memory (currently 512M). - No virtual memory, no memory protection. - DRAM starts at address 0x80000000. Other parts of memory may be used for MMIO, etc. - The second highest address bit is the "cache" bit, and 0x80000000 and 0x84000000 alias to the same memory. To support the above, we make the following changes: - Use a ShadowScale of 5, to reduce shadow memory overhead. - Adjust some existing macros to remove assumption that the lowest memory address is 0. - add a RawAddr macro that on Myriad strips the cache bit from the input address, before using the address for shadow memory (for other archs this does nothing). - We must check that an address is in DRAM range before using it to index into shadow memory. Differential Revision: https://reviews.llvm.org/D46456 llvm-svn: 332690
* [sanitizer] Trivial portion of the port to Myriad RTEMSWalter Lee2018-05-1815-28/+44
| | | | | | | | | | | | | | | | | | | | | This commit contains the trivial portion of the port of ASan to Myriad RTEMS. - Whitelist platform in sanitizer_platform.h, ubsan_platform.h - Turn off general interception - Use memset for FastPoisonShadow - Define interception wrappers - Set errno symbol correctly - Enable ASAN_LOW_MEMORY - Enable preinit array - Disable slow unwinding - Use fuchsia offline symbolizer - Disable common code for: InitializeShadowMemory, CreateMainThread, AsanThread::ThreadStart, StartReportDeadlySignal, MaybeReportNonExecRegion. Differential Revision: https://reviews.llvm.org/D46454 llvm-svn: 332681
* [asan] Add a magic shadow value for shadw gapWalter Lee2018-05-162-0/+4
| | | | | | | | | This gives us something to insert into the shadow gap for systems that don't have memory protection turned on there (i.e. on Myriad). Differential Revision: https://reviews.llvm.org/D46457 llvm-svn: 332557
* [libFuzzer] add an experimental flag -focus_function: libFuzzer will try to ↵Kostya Serebryany2018-05-168-2/+64
| | | | | | focus on inputs that trigger that function llvm-svn: 332554
* [asan] Restore check removed by r332033Walter Lee2018-05-161-0/+2
| | | | | | | | Needed by fiber handling code, and possibly other code paths. Differential Revision: https://reviews.llvm.org/D46981 llvm-svn: 332553
OpenPOWER on IntegriCloud