summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [sanitizer] Introduce a vDSO aware time function, and use it in the ↵Kostya Kortchinsky2017-12-1112-6/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | allocator [redo] Summary: Redo of D40657, which had the initial discussion. The initial code had to move into a libcdep file, and things had to be shuffled accordingly. `NanoTime` is a time sink when checking whether or not to release memory to the OS. While reducing the amount of calls to said function is in the works, another solution that was found to be beneficial was to use a timing function that can leverage the vDSO. We hit a couple of snags along the way, like the fact that the glibc crashes when clock_gettime is called from a preinit_array, or the fact that `__vdso_clock_gettime` is mangled (for security purposes) and can't be used directly, and also that clock_gettime can be intercepted. The proposed solution takes care of all this as far as I can tell, and significantly improve performances and some Scudo load tests with memory reclaiming enabled. @mcgrathr: please feel free to follow up on https://reviews.llvm.org/D40657#940857 here. I posted a reply at https://reviews.llvm.org/D40657#940974. Reviewers: alekseyshl, krytarowski, flowerhack, mcgrathr, kubamracek Reviewed By: alekseyshl, krytarowski Subscribers: #sanitizers, mcgrathr, srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D40679 llvm-svn: 320409
* [libFuzzer] even less aggressive step function for stack depth. Also don't ↵Kostya Serebryany2017-12-091-1/+12
| | | | | | use asan in one test to speed it up llvm-svn: 320259
* [libFuzzer] make the stack depth signal less agressive, otherwise we are ↵Kostya Serebryany2017-12-091-1/+1
| | | | | | sometimes exploding the corpus size. This still needs more analysis and tuning llvm-svn: 320237
* Correct handling of the TLS/NetBSD block of the main programKamil Rytarowski2017-12-091-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Include <sys/tls.h> for: - struct tls_tcb - thread control block structure - __HAVE___LWP_GETTCB_FAST - __lwp_gettcb_fast() is available - __HAVE___LWP_GETPRIVATE_FAST - __lwp_getprivate_fast() is available - __HAVE_TLS_VARIANT_I - TLS Variant I for this architecture - __HAVE_TLS_VARIANT_II - TLS Variant II for this architecture Rename ThreadSelfSegbase() to ThreadSelfTlsTcb and switch it to retrieve in a portable way TCB. Switch ThreadSelf() to retrieve pthread from struct tcb_tls. Use dl_iterate_phdr() to find out the size of TLS block of the main program. Correct the index of the TLS block of the main program (dlpi_tls_modid); it's 1, not 2. New NetBSD code is now CPU (NetBSD port) agnostic. Stop sharing the same code with FreeBSD. Sponsored by <The NetBSD Foundation> Reviewers: dvyukov, joerg, vitalybuka Reviewed By: vitalybuka Subscribers: emaste, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40159 llvm-svn: 320234
* Hardware-assisted AddressSanitizer (compiler-rt)Evgeniy Stepanov2017-12-0920-0/+2275
| | | | | | | | | | | | | | Summary: Runtime library for HWASan, initial commit. Does not randomize tags yet, does not handle stack or globals. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, kubamracek, dberris, mgorny, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40935 llvm-svn: 320231
* NetBSD ships with POSIX strerror_r(3)Kamil Rytarowski2017-12-091-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Switch NetBSD from GNU to the POSIX strerror_r(3) interceptor. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41019 llvm-svn: 320221
* Add NetBSD/x86_64 mapping in MSanKamil Rytarowski2017-12-092-2/+3
| | | | | | | | | | | | | | | | | | | Summary: Reuse the Linux new mapping as it is. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41023 llvm-svn: 320218
* [libFuzzer] Add support for Fuchsia OS.Matt Morehouse2017-12-086-2/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the initial support for Fuchsia. - LIBFUZZER_FUCHSIA is added as an OS type in FuzzerDefs.h - Fuchsia is, by design, not POSIX compliant. However, it does use ELF and supports common POSIX I/O functions. Thus, FuzzerExtFunctions.h and FuzzerIO.h are implemented by extending the header guards in FuzzerExtFunctionsWeak.cpp and FuzzerIOPosix.cpp to include LIBFUZZER_FUCHSIA. - The platform-specific portions of FuzzerUtil.h are implemented by FuzzerUtilFuchsia.cpp, which makes use of exception ports, syscalls, and the launchpad library. - The experimental equivalence server is not currently supported, so FuzzerShmem.h is implemented by stub methods in FuzzerShmemFuchsia.cpp. Any future implementation will likely involve VMOs. Tested with ASAN/SanCov on Fuchsia/x86-64 with the canonical toy fuzzer. Patch By: aarongreen Reviewers: kcc, morehouse, flowerhack, phosek Reviewed By: kcc, phosek, Eugene.Zelenko Subscribers: srhines, mgorny, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D40974 llvm-svn: 320210
* [libFuzzer] honor -use_counters, sligntly change the meaning of ↵Kostya Serebryany2017-12-083-8/+18
| | | | | | -experimental_len_control, call UpdateFeatureFrequency only if instructed by the flag llvm-svn: 320205
* [scudo] Minor code generation improvementKostya Kortchinsky2017-12-082-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: It looks like clang was generating somewhat weird assembly with the current code. `FromPrimary`, even though `const`, was replaced every time with the code generated for `size <= SizeClassMap::kMaxSize` instead of using a variable or register, and `FromPrimary` didn't induce `ClassId != 0` for the compiler, so a dead branch was generated for `getActuallyAllocatedSize(Ptr, ClassId)` since it's never called for `ClassId = 0` (Secondary backed allocations) [this one was more wishful thinking on my side than anything else]. I rearranged the code bit so that the generated assembly is less clunky. Also changed 2 whitespace inconsistencies that were bothering me. Reviewers: alekseyshl, flowerhack Reviewed By: flowerhack Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D40976 llvm-svn: 320160
* [PowerPC][asan] Update asan to handle changed memory layouts in newer kernelsBill Seurer2017-12-071-1/+1
| | | | | | | | | | | | | | | In more recent Linux kernels with 47 bit VMAs the layout of virtual memory for powerpc64 changed causing the address sanitizer to not work properly. This patch adds support for 47 bit VMA kernels for powerpc64 and fixes up test cases. https://reviews.llvm.org/D40908 There is an associated patch for trunk. Tested on several 4.x and 3.x kernel releases. llvm-svn: 320110
* [libFuzzer] Decrease stack usage in unit testsKostya Serebryany2017-12-061-26/+26
| | | | | | | | | | | | Summary: With 3 Dictionary objects, each containing space of ~16k DictionaryEntry objects, the MutationDispatcher object is fairly memory heavy. On platforms with a lower default stack size, this can cause panics in FuzzerUnittest as those tests stack-allocate the MutationDispatcher. This may be especially problematic for platforms that do not (yet) have a way to programmatically change their stack size, aside from link-time flags. In general, it seems more prudent to use the heap for an object of this size. Reviewers: kcc, morehouse Reviewed By: kcc Differential Revision: https://reviews.llvm.org/D40926 llvm-svn: 319988
* Update other SizeEnums to be of type uptr as wellVlad Tsyrklevich2017-12-062-2/+2
| | | | llvm-svn: 319984
* Revert SVN r, 319967Kamil Rytarowski2017-12-061-63/+3
| | | | | | | | "Correct atexit(3) support in MSan/NetBSD" This causes failures on Linux. llvm-svn: 319981
* Fix broken windows sanitizer buildbotVlad Tsyrklevich2017-12-061-1/+1
| | | | | | | r319875 caused a sign comparison build failure. Explicitly set the enum's type to be unsigned. llvm-svn: 319977
* [libFuzzer] fix a minor regression in printingKostya Serebryany2017-12-061-1/+1
| | | | llvm-svn: 319975
* Correct atexit(3) support in MSan/NetBSDKamil Rytarowski2017-12-061-3/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The NetBSD specific implementation of cxa_atexit() does not preserve the 2nd argument if dso is equal to NULL. Changes: - Split paths of handling intercepted __cxa_atexit() and atexit(3). This affects all supported Operating Systems. - Add a local stack-like structure to hold the __cxa_atexit() context. atexit(3) is documented in the C standard as calling callback from the earliest to the oldest entry. This path also fixes potential ABI problem of passing an argument to a function from the atexit(3) callback mechanism. - Allow usage of global vars with ctors in interceptors. This allows to use Vector without automatic cleaning up the structures. This code has been modeled after TSan implementation for the same functions. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40714 llvm-svn: 319967
* Handle NetBSD symbol renaming in msan_interceptors.ccKamil Rytarowski2017-12-063-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD renames symbols for historical and compat reasons. Add required symbol renames in sanitizer_common_interceptors.inc: - gettimeofday -> __gettimeofday50 - getrusage -> __getrusage50 - shmctl -> __shmctl50 Additionally handle sigaction symbol mangling. Rename the function symbol in the file to SIGACTION_SYMNAME and define it as __sigaction14 for NetBSD and sigaction for !NetBSD. We cannot use simple renaming with the proprocessor, as there are valid fields named sigaction and they must be left intact. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka, dvyukov Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40766 llvm-svn: 319966
* [TSan] Make more TSan interceptors symbolizer-aware.Alex Shlyapnikov2017-12-061-9/+25
| | | | | | | | | | | | | | | | | | Summary: Switching the rest of intercepted allocs to InternalAlloc (well, except __libc_memalign) when current thread is 'in_symbolizer'. Symbolizer might (and does) use allocation functions other than malloc/calloc/realloc. posix_memalign is the one actually used, others switched just in case (since the failure is obscure and not obvious to diagnose). Reviewers: dvyukov Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D40877 llvm-svn: 319929
* [Sanitizers] Use SANITIZER_* macros in lib/interceptionKamil Rytarowski2017-12-068-45/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Unlike the rest of the sanitizer code, lib/interception uses native macros like __linux__ to check for specific targets instead of the common ones like SANITIZER_LINUX. When working on the Solaris port of the sanitizers, the current style was found to not only be inconsistent, but clumsy to use because the canonical way to check for Solaris is to check for __sun__ && __svr4__ which is a mouthful. Therefore, this patch switches to use SANITIZER_* macros instead. Tested on x86_64-pc-linux-gnu. Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: #sanitizers, srhines, krytarowski, llvm-commits, fedor.sergeev Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39798 llvm-svn: 319906
* [scudo] Correct performance regression in SecondaryKostya Kortchinsky2017-12-061-8/+10
| | | | | | | | | | | | | | | | | | | | | | Summary: This wasn't noticed: `RoundUpTo` doesn't produce a constant expression, so the sizes were not constant either. Enforce them to be static const, replace `RoundUpTo` by its expression. The compiler can now optimize the associated computations accordingly. Also looking at the produced assembly, `PageSize` was fetched multiple times during `Allocate`, so keep a local value of it. As a result it's fetched once and kept in a register. Reviewers: alekseyshl, flowerhack Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40862 llvm-svn: 319903
* [compiler-rt][xray][cmake] Fix a build issue caused by set/item mixupSimon Dardis2017-12-061-1/+1
| | | | | | | | | | | | | | | | r319165 introduced a change to CMakeLists.txt for xray where the set of supported architectures for XRay was iterated over, tested if they could be targeted then passed to add_compiler_rt_object_libraries. However all targets were passed, rather than the architecture that was just tested. For cases such as MIPS, where mips and mips64 are supported, cmake would then test if mips64 could be targetted resulting in an attempt to produce multiple identical logical target names, falling afowl of CMP0002. Reviewers: dberris Differential Revision: https://reviews.llvm.org/D40890 llvm-svn: 319893
* Fix typo fcvr -> fcvt and attempt to unbreak MSan/!NetBSDKamil Rytarowski2017-12-061-1/+1
| | | | llvm-svn: 319872
* Fix typo gcvr -> gcvt and attempt to unbreak MSan/!NetBSDKamil Rytarowski2017-12-061-1/+1
| | | | llvm-svn: 319871
* Support pthread_key_create symbol alias in MSan/NetBSDKamil Rytarowski2017-12-061-0/+10
| | | | | | | | | | | | | | | | | | | | | Summary: NetBSD uses indirection symbol for a set of threading functions. Add alias to handle __libc_thr_keycreate the same way as pthread_key_create. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40767 llvm-svn: 319868
* Disable absent functions in MSan/NetBSD interceptorsKamil Rytarowski2017-12-061-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Disable for NetBSD missing functions missing in this OS: - mempcpy, - __libc_memalign, - malloc_usable_size, - stpcpy, - gcvt, - wmempcpy, - fcvt. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40764 llvm-svn: 319866
* [msan] Fix formattingVitaly Buka2017-12-051-1/+1
| | | | llvm-svn: 319844
* [msan] add strtouq msan interceptorVitaly Buka2017-12-052-0/+3
| | | | | | | | | | | | Summary: Fixes https://github.com/google/sanitizers/issues/892 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40853 llvm-svn: 319843
* [libFuzzer] Make redirects happen in proper sequence.Matt Morehouse2017-12-052-3/+3
| | | | | | | "> file" must come before "2>&1" to have redirection occur correctly in all cases. Fixes a regression on minimize_two_crashes.test. llvm-svn: 319792
* [scudo] Get rid of the thread local PRNG & header saltKostya Kortchinsky2017-12-055-115/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It was deemed that the salt in the chunk header didn't improve security significantly (and could actually decrease it). The initial idea was that the same chunk would different headers on different allocations, allowing for less predictability. The issue is that gathering the same chunk header with different salts can give information about the other "secrets" (cookie, pointer), and that if an attacker leaks a header, they can reuse it anyway for that same chunk anyway since we don't enforce the salt value. So we get rid of the salt in the header. This means we also get rid of the thread local Prng, and that we don't need a global Prng anymore as well. This makes everything faster. We reuse those 8 bits to store the `ClassId` of a chunk now (0 for a secondary based allocation). This way, we get some additional speed gains: - `ClassId` is computed outside of the locked block; - `getActuallyAllocatedSize` doesn't need the `GetSizeClass` call; - same for `deallocatePrimary`; We add a sanity check at init for this new field (all sanity checks are moved in their own function, `init` was getting crowded). Reviewers: alekseyshl, flowerhack Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40796 llvm-svn: 319791
* [XRay][compiler-rt] Use __sanitizer::Atexit() instead of atexit()Dean Michael Berris2017-12-051-1/+1
| | | | | | Follow-up to D40828. llvm-svn: 319764
* [XRay][compiler-rt] Implement XRay Basic Mode FilteringDean Michael Berris2017-12-051-54/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change implements the basic mode filtering similar to what we do in FDR mode. The implementation is slightly simpler in basic-mode filtering because we have less details to remember, but the idea is the same. At a high level, we do the following to decide when to filter function call records: - We maintain a per-thread "shadow stack" which keeps track of the XRay instrumented functions we've encountered in a thread's execution. - We push an entry onto the stack when we enter an XRay instrumented function, and note the CPU, TSC, and type of entry (whether we have payload or not when entering). - When we encounter an exit event, we determine whether the function being exited is the same function we've entered recently, was executing in the same CPU, and the delta of the recent TSC and the recorded TSC at the top of the stack is less than the equivalent amount of microseconds we're configured to ignore -- then we un-wind the record offset an appropriate number of times (so we can overwrite the records later). We also support limiting the stack depth of the recorded functions, so that we don't arbitrarily write deep function call stacks. Reviewers: eizan, pelikan, kpw, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40828 llvm-svn: 319762
* [XRay][compiler-rt] Implement logging implementation registrationDean Michael Berris2017-12-054-23/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows for registration of multiple logging implementations through a central mechanism in XRay, mapping an implementation to a "mode". Modes are strings that are used as keys to determine which implementation to install through a single API. This mechanism allows users to choose which implementation to install either from the environment variable 'XRAY_OPTIONS' with the `xray_mode=` flag, or programmatically using the `__xray_select_mode(...)` function. Here, we introduce two API functions for the XRay logging: __xray_log_register_mode(Mode, Impl): Associates an XRayLogImpl to a string Mode. We can only have one implementation associated with a given Mode. __xray_log_select_mode(Mode): Finds the associated Impl for Mode and installs it as if by calling `__xray_set_log_impl(...)`. Along with these changes, we also deprecate the xray_naive_log and xray_fdr_log flags and encourage users to instead use the xray_mode flag. Reviewers: kpw, dblaikie, eizan, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40703 llvm-svn: 319759
* [libFuzzer] Remove const from ignoreRemainingArgs return value.Matt Morehouse2017-12-041-2/+2
| | | | | | In this case const does nothing but trigger a warning. llvm-svn: 319685
* [libFuzzer] Remove FuzzerCommand.cpp from build sources.Matt Morehouse2017-12-041-1/+0
| | | | | | | FuzzerCommand.cpp was not introduced in r319680. Instead, it was implemented in the header file. llvm-svn: 319682
* [libFuzzer] Encapsulate commands in a class.Matt Morehouse2017-12-049-43/+400
| | | | | | | | | | | | | | | | | | | | | Summary: To be more portable (especially w.r.t. platforms without system()), commands should be managed programmatically rather than via string manipulation on the command line. This change introduces Fuzzer::Command, with methods to manage arguments and flags, set output options, and execute the command. Patch By: aarongreen Reviewers: kcc, morehouse Reviewed By: kcc, morehouse Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D40103 llvm-svn: 319680
* [sanitizer] 64-bit allocator's PopulateFreeArray partial refactorKostya Kortchinsky2017-12-041-39/+47
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This is an attempt at making `PopulateFreeArray` less obscure, more consistent, and a tiny bit faster in some circumstances: - use more consistent variable names, that work both for the user & the metadata portions of the code; the purpose of the code is mostly the same for both regions, so it makes sense that the code should be mostly similar as well; - replace the while sum loops with a single `RoundUpTo`; - mask most of the metadata computations behind kMetadataSize, allowing some blocks to be completely optimized out if not use metadata; - `const` the constant variables; - add a `LIKELY` as the branch it applies to will almost always be taken. Reviewers: alekseyshl, flowerhack Reviewed By: alekseyshl Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D40754 llvm-svn: 319673
* Handle NetBSD symbol renaming in sanitizer_common_interceptors.incKamil Rytarowski2017-12-041-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD renames symbols for historical and compat reasons. Add required symbol renames in sanitizer_common_interceptors.inc: - clock_gettime -> __clock_gettime50 - clock_getres -> __clock_getres50 - clock_settime -> __clock_settime50 - setitimer -> __setitimer50 - getitimer -> __getitimer50 - opendir -> __opendir30 - readdir -> __readdir30 - time -> __time50 - localtime_r -> __localtime_r50 - gmtime_r -> __gmtime_r50 - gmtime -> __gmtime50 - ctime -> __ctime50 - ctime_r -> __ctime_r50 - mktime -> __mktime50 - getpwnam -> __getpwnam50 - getpwuid -> __getpwuid50 - getpwnam_r -> __getpwnam_r50 - getpwuid_r -> __getpwuid_r50 - getpwent -> __getpwent50 - glob -> __glob30 - wait3 -> __wait350 - wait4 -> __wait450 - readdir_r -> __readdir_r30 - setlocale -> __setlocale50 - scandir -> __scandir30 - sigtimedwait -> __sigtimedwait50 - sigemptyset -> __sigemptyset14 - sigfillset -> __sigfillset14 - sigpending -> __sigpending14 - sigprocmask -> __sigprocmask14 - shmctl -> __shmctl50 - times -> __times13 - stat -> __stat50 - getutent -> __getutent50 - getutxent -> __getutxent50 - getutxid -> __getutxid50 - getutxline -> __getutxline50 Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, cryptoad, dvyukov Reviewed By: cryptoad Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40765 llvm-svn: 319670
* [ASan] Enhance libsanitizer support for invalid-pointer-pair.Alex Shlyapnikov2017-12-045-7/+98
| | | | | | | | | | | | | | | | | | | | Following patch adds support of all memory origins in CheckForInvalidPointerPair function. For small difference of pointers, it's directly done in shadow memory (the limit was set to 2048B). Then we search for origin of first pointer and verify that the second one has the same origin. If so, we verify that it points either to a same variable (in case of stack memory or a global variable), or to a same heap segment. Committing on behanf of marxin and jakubjelinek. Reviewers: alekseyshl, kcc Subscribers: llvm-commits Differential revision: https://reviews.llvm.org/D40600 llvm-svn: 319668
* Move __tsan::Vector to __sanitizerKamil Rytarowski2017-12-0414-49/+47
| | | | | | | | | | | | | | | | | | | | | Summary: The low-fat STL-like vector container will be reused in MSan. It is needed to implement an atexit(3) interceptor on NetBSD/amd64 in MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc Reviewed By: dvyukov Subscribers: kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40726 llvm-svn: 319650
* [libFuzzer] add a flag -malloc_limit_mbKostya Serebryany2017-12-014-1/+8
| | | | llvm-svn: 319590
* [libFuzzer] remove stale flags; NFCKostya Serebryany2017-12-014-13/+0
| | | | llvm-svn: 319572
* [libFuzzer] add an experimental search heuristic flag -reduce_depthKostya Serebryany2017-12-015-5/+18
| | | | llvm-svn: 319571
* [msan] Fix return type of mbrtowcVitaly Buka2017-11-302-8/+11
| | | | | | | | | | | | Summary: Fixes https://github.com/google/oss-fuzz/issues/1009 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40676 llvm-svn: 319484
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-11-301-0/+14
| | | | | | | | Now that we have disabled the run-forever tests, and cleaned up the intel 80-bit float based tests, we should be able to enable testing compiler-rt for powerpc64. llvm-svn: 319474
* Move x86-specific sources to x86-specific source lists.Sterling Augustine2017-11-301-13/+22
| | | | llvm-svn: 319464
* Fix the MIPS baremetal buildAlexander Richardson2017-11-301-2/+2
| | | | | | | | | | | | | | | | Summary: Currently sys/cachectl.h is used unconditionally on MIPS although it is only available on Linux and will fail the build when targeting baremetal Reviewers: petarj Reviewed By: petarj Subscribers: sdardis, krytarowski Differential Revision: https://reviews.llvm.org/D40659 llvm-svn: 319455
* Linux needs to include sys/uio.h for readv, preadvStephan Bergmann2017-11-301-0/+3
| | | | | | ...at least when building against glibc-2.26-16.fc27.x86_64 llvm-svn: 319412
* [XRay][compiler-rt][Darwin] Use dynamic initialisation as an alternativeDean Michael Berris2017-11-291-1/+8
| | | | | | | | | | | | | | | | Summary: In cases where we can't use the .preinit_array section (as in Darwin for example) we instead use dynamic initialisation. We know that this alternative approach will race with the initializers of other objects at global scope, but this is strictly better than nothing. Reviewers: kubamracek, nglevin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40599 llvm-svn: 319366
* [sanitizer] Add 'strip_env' flag to enable/disable removing sanitizer dylib ↵Kuba Mracek2017-11-292-0/+6
| | | | | | | | | | from DYLD_INSERT_LIBRARIES On macOS, we usually don't require launching the target with DYLD_INSERT_LIBRARIES anymore. However, it is still necessary when running a target that is not instrumented (and e.g. dlopen's an instrument library later). In any case, ASan and TSan currently remove themselves from the DYLD_INSERT_LIBRARIES environment variable to avoid passing it onto children. This works well e.g. when instrumenting a shell. A problem arises when the target is a non-instrumented shim (e.g. "xcrun") that either re-execs or launches a child that is supposed to get DYLD_INSERT_LIBRARIES propagated. To support this mode, this patch introduces 'strip_env' flag that can be used to keep DYLD_INSERT_LIBRARIES untouched. Differential Revision: https://reviews.llvm.org/D39991 llvm-svn: 319365
OpenPOWER on IntegriCloud