summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-09-15[libFuzzer] minor refactoring, NFCKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15[libFuzzer] reduce the size of the merge control file by not dumping ↵Kostya Serebryany
redundant features into it git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15ubsan: Unbreak ubsan_cxx runtime library on Windows.Peter Collingbourne
This was originally broken by r258744 which introduced a weak reference from ubsan to ubsan_cxx. This reference does not work directly on Windows because COFF has no direct concept of weak symbols. The fix is to use /alternatename to create a weak external reference to ubsan_cxx. Also fix the definition (and the name, so that we drop cached values) of the cmake flag that controls whether to build ubsan_cxx. Now the user-controllable flag is always on, and we turn it off internally depending on whether we support building it. Differential Revision: https://reviews.llvm.org/D37882 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313391 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15ubsan: Stop building the DLL version of the runtime library on Windows.Peter Collingbourne
As far as I know we never use it. Differential Revision: https://reviews.llvm.org/D37884 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15[sanitizer][mips64] fix MIPS64 kernel_stat_to_stat()Petar Jovanovic
This patch tackles with two issues: Output stat st_[a|m|c]time fields were holding wrong values. st_[a|m|c]time fields should have contained value of seconds and instead these are filled with st_[a|m|c]time_nsec fields which hold nanoseconds. Build fails for MIPS64 if SANITIZER_ANDROID. Recently <sys/stat.h> from bionic introduced st_[a|m|c]time_nsec macros for compatibility with old NDKs and those clashed with the field names of the <asm/stat.h> kernel_stat structure. To fix both issues and make sure sanitizer builds on all platforms, we must un-define all compatibility macros and access the fields directly when copying the 'time' fields. Patch by Miodrag Dinic <miodrag.dinic@imgtec.com> Differential Revision: https://reviews.llvm.org/D35671 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313360 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15[ubsan] Extract GetStackTraceWithPcBpAndContext similar to asan versionVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313350 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15tsan: respect LDFLAGS when build Go testDmitry Vyukov
Reported at: https://bugs.llvm.org/show_bug.cgi?id=27597 Some platforms need additional LDFLAGS when building the test (e.g. -no-pie). Respect LDFLAGS. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313347 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15[sanitizer] Use __sanitizer:: in CHECK_IMPL on both sides of assignmentVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[sanitizer] Move stack overflow and signal reporting from Asan into common.Vitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D37844 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[asan] Remove ErrorStackOverflowVitaly Buka
Summary: The only difference from ErrorDeadlySignal is reporting code and it lives in sanitizer common. Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl, filcab Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37868 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313309 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[scudo] Fix bad request handling when allocator has not been initializedKostya Kortchinsky
Summary: In a few functions (`scudoMemalign` and the like), we would call `ScudoAllocator::FailureHandler::OnBadRequest` if the parameters didn't check out. The issue is that if the allocator had not been initialized (eg: if this is the first heap related function called), we would use variables like `allocator_may_return_null` and `exitcode` that still had their default value (as opposed to the one set by the user or the initialization path). To solve this, we introduce `handleBadRequest` that will call `initThreadMaybe`, allowing the options to be correctly initialized. Unfortunately, the tests were passing because `exitcode` was still 0, so the results looked like success. Change those tests to do what they were supposed to. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37853 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[sanitizer] Add empty Fuchsia and Win versions of StartReportDeadlySignalVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[lsan] Extract GetStackTraceWithPcBpAndContext similar to asan versionVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313239 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[sanitizer] Move IsStackOverflow into SignalContextVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[sanitizer] Add BufferedStackTrace::Reset()Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[asan] Add const into ScarinessScoreBase::PrintVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[compiler-rt] Fix Windows buildVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313224 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[compiler-rt] Cleanup SignalContext initializationVitaly Buka
Reviewers: eugenis, alekseyshl Subscribers: kubamracek, dberris Differential Revision: https://reviews.llvm.org/D37827 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[asan] Fix Windows buildVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Use SignalContext in ErrorStackOverflow and ErrorDeadlySignalVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl, filcab Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37793 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313168 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Add siginfo into SignalContextVitaly Buka
Summary: Information stored there is often been passed along with SignalContext. Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37792 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313167 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Compile signal specific functions only for !SANITIZER_GOVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313130 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13Fix line breaks.Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313118 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Move dump_instruction_bytes and dump_registers into ↵Vitaly Buka
sanitizer_common Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37766 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313117 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Move *Sanitizer:DEADLYSIGNAL printing into common partVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[Fuchsia] Magenta -> ZirconPetr Hosek
Fuchsia's lowest API layer has been renamed from Magenta to Zircon. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D37770 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Move IsStackOverflow into sanitizer_posix_libcdep.cc to the restVitaly Buka
of instrumentation code. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313100 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12[libFuzzer] factor out some code into GetSizedFilesFromDir; NFCKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313081 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12[libfuzzer] Compare TotalNumberOfRuns with MaxNumberOfRuns when testing a ↵Max Moroz
memory leak. Summary: Fuzzer::TryDetectingAMemoryLeak may call ExecuteCallback which would increment TotalNumberOfRuns, but it doesn't respect Options.MaxNumberOfRuns value specified by a user. Context: https://github.com/google/oss-fuzz/issues/822#issuecomment-328153970 Reviewers: kcc Reviewed By: kcc Differential Revision: https://reviews.llvm.org/D37632 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312993 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12[XRay][compiler-rt] Use a single global volatile recursion guard for FDR ↵Dean Michael Berris
handlers Summary: Before this change, the recursion guard for the flight data recorder (FDR) mode handlers were independent. This change makes it so that when a handler is already in the process of running and somehow the same or another handler starts running -- say in a signal handler, while the XRay handler is executing -- then we can use the same thread-local recursion guard to stop the second handler from running. Reviewers: kpw, eizan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37612 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12[compiler-rt] Move IsStackOverflow from asan into sanitizer_commonVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D37536 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312987 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12Revert "[compiler-rt] Move IsStackOverflow from asan into sanitizer_common"Vitaly Buka
Windows is broken. This reverts commit r312951 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312984 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11Runtime detection of android_set_abort_message.Evgeniy Stepanov
Summary: Use runtime detection (with a weak-undef symbol) of android_set_abort_message availability. Android NDK provides a single version of the ASan runtime library to be used for any target API level, which makes compile-time feature detection impossible (the library itself is built at API level 9). Reviewers: vitalybuka Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37716 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312973 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[ubsan-minimal] Enable on DarwinVedant Kumar
Testing: check-ubsan-minimal Differential Revision: https://reviews.llvm.org/D37646 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312959 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[ubsan] Make ubsan version of __sanitizer_print_stack_trace consistent with ↵Vitaly Buka
other sanitizers Summary: Other sanitizers include __sanitizer_print_stack_trace into stack trace. Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37657 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312954 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[ubsan] Save binary name before parsing optionsVitaly Buka
Summary: To parser "include" we may need to do binary name substitution. Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37658 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11Revert "[ubsan] Save binary name before parsing options"Vitaly Buka
Patch was corrupted by rebase. This reverts commit r312933 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[compiler-rt] Move IsStackOverflow from asan into sanitizer_commonVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D37536 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[compiler-rt] Cleanup decoratorsVitaly Buka
Summary: Removed redundant End*() methods which defined same way. Removed redundant Warning() methods. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37549 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[scudo] Fix improper TSD init after TLS destructors are calledKostya Kortchinsky
Summary: Some of glibc's own thread local data is destroyed after a user's thread local destructors are called, via __libc_thread_freeres. This might involve calling free, as is the case for strerror_thread_freeres. If there is no prior heap operation in the thread, this free would end up initializing some thread specific data that would never be destroyed properly (as user's pthread destructors have already been called), while still being deallocated when the TLS goes away. As a result, a program could SEGV, usually in __sanitizer::AllocatorGlobalStats::Unregister, where one of the doubly linked list links would refer to a now unmapped memory area. To prevent this from happening, we will not do a full initialization from the deallocation path. This means that the fallback cache & quarantine will be used if no other heap operation has been called, and we effectively prevent the TSD being initialized and never destroyed. The TSD will be fully initialized for all other paths. In the event of a thread doing only frees and nothing else, a TSD would never be initialized for that thread, but this situation is unlikely and we can live with that. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37697 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[ubsan] Save binary name before parsing optionsVitaly Buka
Summary: To parser "include" we may need to do binary name substitution. Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37658 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09[asan] Use more generic string in error messageVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37609 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09[libFuzzer] remove a couple of reduntant includesKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07[asan] Add a note to shadow memory setup error.Evgeniy Stepanov
Point to https://github.com/google/sanitizers/issues/856 as a possible cause of the failed mapping. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312687 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06[scudo] getauxval alternative for AndroidKostya Kortchinsky
Summary: `getauxval` was introduced with API level 18. In order to get things to work at lower API levels (for the toolchain itself which is built at 14 for 32-bit), we introduce an alternative implementation reading directly from `/proc/self/auxv`. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D37488 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312653 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06[msan] Remove a stale fixme (NFC).Evgeniy Stepanov
It was fixed in 312576. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312597 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06[sanitizer_common][Fuchsia] Update Fuchsia sanitizer markupPetr Hosek
Include URLs to the markup format specification in code comments. Use sanitizer markup in the sancov message about a dump just produced. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D37273 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05Remove ld.config.txt for Android O.Evgeniy Stepanov
ld.config.txt defines linker namespaces in a way that is incompatible with ASan. Remove the file when installing ASan on an Android O (8.0.x) device. Patch by Jiyong Park. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05[msan] Check sigset_t and sigaction arguments.Evgeniy Stepanov
Summary: Check sigset_t arguments in ppoll, sig*wait*, sigprocmask interceptors, and the entire "struct sigaction" in sigaction. This can be done because sigemptyset/sigfullset are intercepted and signal masks should be correctly marked as initialized. Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D37367 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-02(NFC) Fix the use of do{}while(0) in a macro.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312396 91177308-0d34-0410-b5e6-96231b3b80d8