summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-03-03Remove obsolete ptrace(2) operations from NetBSDKamil Rytarowski
PT_SET_SIGMASK and PT_GET_SIGMASK will be removed from NetBSD without backward compat (it shortlived in a development branch). Sponsored by <The NetBSD Foundation> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326657 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-03Revert D44035Kamil Rytarowski
Broken syntax. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326655 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-03Hotfix for D44035Kamil Rytarowski
Try to fix the syntax. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326654 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-03Support OpenBSD in common interceptorsKamil Rytarowski
Summary: Extract INIT_PTHREAD_ATTR_GET_SCHED from INIT_PTHREAD_ATTR_GET, as the former is not supported on OpenBSD. Supported interceptors getdetachstate, getguardsize, getscope, getstacksize, getgrouplist and getstack Unsupported getschedparam, getgroupmembership and getschedpolicy Patch by David CARLIER Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: fedor.sergeev, srhines, kubamracek, mgorny, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44035 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326653 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-03OpenBSD UBsan support enabling SANITIZER_OPENBSD widelyKamil Rytarowski
Summary: Adding OpenBSD platform Patch by: David CARLIER Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44049 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326651 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-03OpenBSD UBsan support / commonKamil Rytarowski
Summary: Sanitizer common, enable OpenBSD platform. - Enable common interceptors as possible and create few distinct ones. - Create necessary sanitizer_struct types. Patch by: David CARLIER Reviewers: krytarowski, vitalybuka, visa, kettenis Reviewed By: vitalybuka Subscribers: emaste, srhines, kubamracek, mgorny, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43909 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326650 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-03[msan] Restrict -ftls-model=initial-exec to FreeBSDKamil Rytarowski
Noted by <eugenis> in D43613 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326649 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-03Sanitiser common, using u64 type for GetTid on posix systemsKamil Rytarowski
Summary: Moving from ptr to u64 for GetTid posix implementation. [FreeBSD] Moving from pthread_self to thr_self more appropriate to get thread ID. Patch by: David CARLIER Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43998 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326647 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-03Adding Msan support to FreeBSDKamil Rytarowski
Summary: Enabling the memory sanitizer support for FreeBSD, most of unit tests are compatible. - Adding fstat and stressor_r interceptors. - Updating the struct link_map access since most likely the struct Obj_Entry had been updated since. - Disabling few unit tests until further work is needed (or we can assume it can work in real world code). Patch by: David CARLIER Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Subscribers: eugenis, dim, srhines, emaste, kubamracek, mgorny, fedor.sergeev, hintonda, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43080 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326644 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-02OpenBSD Ubsan support / interceptionKamil Rytarowski
Summary: Interception, enabling OpenBSD platform Patch by: David CARLIER Reviewers: krytarowski, vitalybuka, visa Reviewed By: vitalybuka Subscribers: srhines, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43893 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326544 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-02OpenBSD UBsan support / ubsan partKamil Rytarowski
Summary: UBsan, enable OpenBSD platform Patch by: David CARLIER Reviewers: krytarowski, kettenis, visa, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43894 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326543 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-01[PATCH] [compiler-rt, RISCV] Support builtins for RISC-VShiva Chen
Summary: Support builtins for RISC-V, RV32 and RV64. Reviewers: asb, apazos, mgrang Differential Revision: https://reviews.llvm.org/D42958 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326420 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-28[RISCV] Force enable int128 for compiling long double routinesMandeep Singh Grang
Summary: For RISCV32, we must force enable int128 for compiling long double routines using the flag -fforce-enable-int128. Related clang patch: https://reviews.llvm.org/D43105 Reviewers: asb, kito-cheng, apazos, compnerd, howard.hinnant Reviewed By: kito-cheng Subscribers: shiva0217, efriedma, mgorny, hintonda, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43106 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326346 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27Disable ASan exceptions on NetBSDKamil Rytarowski
This is a workarond for the fallout from D42644: [asan] Intercept std::rethrow_exception indirectly. Reported problem on NetBSD/amd64: $ sh ./projects/compiler-rt/test/sanitizer_common/asan-i386-NetBSD/NetBSD/Output/ttyent.cc.script /usr/lib/i386/libgcc.a(unwind-dw2.o): In function `_Unwind_RaiseException': unwind-dw2.c:(.text+0x1b41): multiple definition of `_Unwind_RaiseException' /public/llvm-build/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.a(asan_interceptors.cc.o):/public/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:337: first defined here clang-7.0: error: linker command failed with exit code 1 (use -v to see invocation) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326216 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27[scudo] Introduce Chunk::getHeaderSizeKostya Kortchinsky
Summary: Instead of using `AlignedChunkHeaderSize`, introduce a `constexpr` function `getHeaderSize` in the `Chunk` namespace. Switch `RoundUpTo` to a `constexpr` as well (so we can use it in `constexpr` declarations). Mark a few variables in the areas touched as `const`. Overall this has no functional change, and is mostly to make things a bit more consistent. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D43772 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326206 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27Add new interceptors: getnetent(3) familyKamil Rytarowski
Summary: getnetent, getnetbyaddr, getnetbyname - get network entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43543 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27Add new interceptors: getprotoent(3) familyKamil Rytarowski
Summary: getprotoent, getprotobynumber, getprotobyname - get protocol entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43541 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326162 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27Add new interceptors: getttyent(3) familyKamil Rytarowski
Summary: getttyent, getttynam, setttyentpath - get ttys file entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43539 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326161 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27[asan] Enable ASAN_INTERCEPT___CXA_THROW for x86 AndroidVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326160 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26Fix build for iOS/ARM ("__Unwind_RaiseException" is not available for armv7).Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326150 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26[asan] Fix build for AndroidVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326149 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26[asan] Intercept std::rethrow_exception indirectlyVitaly Buka
Summary: Fixes Bug 32434 See https://bugs.llvm.org/show_bug.cgi?id=32434 Short summary: std::rethrow_exception does not use __cxa_throw to rethrow the exception, so if it is called from uninstrumented code, it will leave the stack poisoned. This can lead to false positives. Long description: For functions which don't return normally (e.g. via exceptions), asan needs to unpoison the entire stack. It is not known before a call to such a function where execution will continue, some function which don't contain cleanup code like destructors might be skipped. After stack unwinding, execution might continue in uninstrumented code. If the stack has been poisoned before such a function is called, but the stack is unwound during the unconventional return, then zombie redzones (entries) for no longer existing stack variables can remain in the shadow memory. Normally, this is avoided by asan generating a call to asan_handle_no_return before all functions marked as [[noreturn]]. This asan_handle_no_return unpoisons the entire stack. Since these [[noreturn]] functions can be called from uninstrumented code, asan also introduces interceptor functions which call asan_handle_no_return before running the original [[noreturn]] function; for example, cxa_throw is intercepted. If a [[noreturn]] function is called from uninstrumented code (so the stack is left poisoned) and additionally, execution continues in uninstrumented code, new stack variables might be introduced and overlap with the stack variables which have been removed during stack unwinding. Since the redzones are not cleared nor overwritten by uninstrumented code, they remain but now contain invalid data. Now, if the redzones are checked against the new stack variables, false positive reports can occur. This can happen for example by the uninstrumented code calling an intercepted function such as memcpy, or an instrumented function. Intercepting std::rethrow_exception directly is not easily possible since it depends on the C++ standard library implementation (e.g. libcxx vs libstdc++) and the mangled name it produces for this function. As a rather simple workaround, we're intercepting _Unwind_RaiseException for libstdc++. For libcxxabi, we can intercept the ABI function __cxa_rethrow_primary_exception. Patch by Robert Schneider. Reviewers: kcc, eugenis, alekseyshl, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42644 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326132 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26Fix-up for r326106: FindAvailableMemoryRange needs a nullptr as its 5th ↵Kuba Mracek
argument. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326111 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26[asan] Be more careful and verbose when allocating dynamic shadow memoryKuba Mracek
FindAvailableMemoryRange can currently overwrite existing memory (by restricting the VM below addresses that are already used). This patch adds a check to make sure we don't restrict the VM space too much. We are also now more explicit about why the lookup failed and print out verbose values. Differential Revision: https://reviews.llvm.org/D43318 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326106 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26[MSan] Print current stack on CHECK violationAlex Shlyapnikov
Summary: Print current stack on CHECK violation to aid debugging and match other sanitizers functionality. Reviewers: eugenis Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43692 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326105 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26Skip two more ioctl interceptors for NetBSDKamil Rytarowski
Don't intercept: - HFSC_IF_ATTACH - HFSC_MOD_CLASS These operations conflict on NetBSD 32-bit with: - PRIQ_IF_ATTACH - PRIQ_MOD_CLASS Sponsored by <The NetBSD Foundation> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326084 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-24[ubsan-minimal] Fix the ubsan_minimal debug build (COMPILER_RT_DEBUG=1) on ↵Dan Liew
macOS. `ubsan_minimal` makes use of the `_sanitizer::atomic_load` function. This function uses the `DCHECK` macro which in debug builds will use the `_sanitizer::CheckFailed` function. This function is part of `sanitizer_common` but `ubsan_minimal` doesn't use this so the implementation is missing which leads to link failures on macOS when trying to link `libclang_rt.ubsan_minimal_osx_dynamic.dylib`. This is in contrast to the BFD linker on Linux which doesn't seem to care about the missing symbol. A basic implementation of `_sanitizer::CheckFailed` has been added to the `ubsan_minimal` debug build to avoid the link error. The implementation could definitely be improved but I don't know which functions can be used in this context so I decided to restrict myself to functions only being used in `ubsan_minimal` already. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326032 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-24[cfi] Lazy initialization of CFI interceptorsVitaly Buka
Summary: Interceptors initialization may need to allocate memory. So if we initialize too early we can crash in non initialized allocator. Reviewers: pcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43669 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326025 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-24Correct ctype(3) functions with NLS on NetBSDKamil Rytarowski
Summary: The setlocale(3) function reloads the ctype(3) arrays from external files. This happens behind the scenes in the internals of libc (citrus library, runes functions etc). ctype(3) functions like isspace(3) can be provided with two variations on NetBSD: inlined or via a global symbol in libc: ``` #if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \ !defined(__cplusplus) #include <sys/ctype_inline.h> #else #include <sys/ctype_bits.h> #endif ``` The in-lined versions are de-facto array lookup operations. ``` #define isspace(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_S)) ``` After setting setlocale(3) the ctype(3) arrays (_ctype_tab_, _toupper_tab_, _tolower_tab_) are reload behind the scenes and they are required to be marked as initialized. Set them initialized inside the common setlocale(3) interceptor. The arrays are of size of 257 elements: 0..255 + 1 (EOF). This corrects errors on NetBSD/amd64 in applications prebuilt with MSan. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, dvyukov, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42020 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326008 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-24[Sanitizers] Increase allocated chunk limit for LargeMmapAllocatorAlex Shlyapnikov
Summary: There are applications out there which allocate more than 1 << 18 large chunks of memory (those handled by LargeMmapAllocator, aka secondary allocator). For 64 bits, secondary allocator stores allocated chunks in a growing on demand region of memory, growing in blocks of 128K, up to 1 << 20 chunks total. Sanitizer internal allocator's secondary uses fixed size array storing up to 1 << 15 chunks (down to 256K from 2Mb of memory used for that array). Nothing is changed for 32 bits, chunks are still stored in the fixed size array (up to 1 << 15 chunks). Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D43693 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326007 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-22[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.Matt Morehouse
Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43597 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325817 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-21[sanitizer] Allow to set SANITIZER_CAN_USE_PREINIT_ARRAY externallyVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325720 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-21[hwasan] Fix inline instrumentation.Evgeniy Stepanov
This patch changes hwasan inline instrumentation: Fixes address untagging for shadow address calculation (use 0xFF instead of 0x00 for the top byte). Emits brk instruction instead of hlt for the kernel and user space. Use 0x900 instead of 0x100 for brk immediate (0x100 - 0x800 are unavailable in the kernel). Fixes and adds appropriate tests. Patch by Andrey Konovalov. Differential Revision: https://reviews.llvm.org/D43135 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325711 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-21Msan, fixing DTLS_on_tls_get_addr signature empty implementationKamil Rytarowski
Summary: No supported oses normally compiled that code (or not for a long time) probably never caught it. Patch by: David CARLIER Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43502 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325664 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-20Add new interceptor: strmode(3)Kamil Rytarowski
Summary: strmode - convert inode status information into a symbolic string Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43485 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325588 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-20Add new interceptor: fgetln(3)Kamil Rytarowski
Summary: fgetln - get a line from a stream Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43482 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325587 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-20Stop intercepting forkpty(3) and openpty(3) on NetBSDKamil Rytarowski
Summary: forkpty(3) and openpty(3) are part of `-lutil` and we don't intend to reimplement this system library in sanitizers. Everybody using these functions will need to use a precompiled library against MSan or other desired sanitizer. Restrict these functions to Linux-only. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43490 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325585 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-17Recognize all NetBSD architectures in UBSanKamil Rytarowski
Summary: Use uniform accessors for Program Pointer, Stack Pointer and Frame Pointer. Remove CPU check in UBSan supported platforms and rely only on the OS type. This adds NetBSD support in GetPcSpBp() for: - ARM - ARM64 - HPPA - PowerPC/PowerPC64 - SPARC/SPARC64 - MIPS - DEC Alpha AXP - DEC VAX - M68K and M68010 - SH3 - IA64 - OR1K - RISCV Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, ro Reviewed By: vitalybuka Subscribers: aemerson, jyknight, sdardis, kubamracek, arichardson, llvm-commits, kristof.beyls, fedor.sergeev, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43021 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325431 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-16Add initial XRay support for NetBSDKamil Rytarowski
Summary: Reuse the existing FreeBSD code as it is. Sponsored by <The NetBSD Foundation> Reviewers: dberris, rnk, vitalybuka Reviewed By: dberris Subscribers: mclow.lists, emaste, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43370 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325345 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15[TSan] Fix static TLS boundaries calculations in __tls_get_addr interceptor.Alex Shlyapnikov
Summary: DTLS_on_tls_get_addr expects (tls_addr + tls_size) as the last parameter, static_tls_end. Reviewers: dvyukov Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D43325 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325276 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Try to unbreak Darwin after XRay/FreeBSD commitKamil Rytarowski
Add a fallback definition of getTSCFrequency(). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325249 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Implement a large part of NetBSD syscalls of netbsd_syscall_hooks.hKamil Rytarowski
This is a follow up of: r325206 - Add NetBSD syscall hooks skeleton in sanitizers Sponsored by <The NetBSD Foundation> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325248 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Enable syscall-specific functions in TSan/NetBSDKamil Rytarowski
NetBSD ships now with netbsd_syscall_hooks.h and requires support for TSan specific features to be enabled. This is follow up of: D42048: Add NetBSD syscall hooks skeleton in sanitizers Sponsored by <The NetBSD Foundation> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325245 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Add Xray instrumentation support to FreeBSDKamil Rytarowski
Summary: - Enabling the build. - Using assembly for the cpuid parts. - Using thr_self FreeBSD call to get the thread id Patch by: David CARLIER Reviewers: dberris, rnk, krytarowski Reviewed By: dberris, krytarowski Subscribers: emaste, stevecheckoway, nglevin, srhines, kubamracek, dberris, mgorny, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43278 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325240 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Teach sanitizer about NetBSD specific ioctl(2) callsKamil Rytarowski
Summary: Introduce handling of 1200 NetBSD specific ioctl(2) calls. Over 100 operations are disabled as unavailable or conflicting with the existing ones (the same operation number). Add a script that generates the rules to detect ioctls on NetBSD. The generate_netbsd_ioctls.awk script has been written in NetBSD awk(1) (patched nawk) and is compatible with gawk. Generate lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc with the awk(1) script. Update sanitizer_platform_limits_netbsd accordingly to add the needed definitions. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, dvyukov Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, fedor.sergeev, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41636 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325212 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Prevent recursive MSan interceptors in strftime(3) like functionsKamil Rytarowski
Summary: This corrects intercepting this call on NetBSD without false positives. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42883 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325208 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Prevent recursive MSan interceptors in fgets(3)Kamil Rytarowski
Summary: This corrects intercepting this call on NetBSD without false positives. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42884 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325207 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Add NetBSD syscall hooks skeleton in sanitizersKamil Rytarowski
Summary: Implement the skeleton of NetBSD syscall hooks for use with sanitizers. Add a script that generates the rules to handle syscalls on NetBSD: generate_netbsd_syscalls.awk. It has been written in NetBSD awk(1) (patched nawk) and is compatible with gawk. Generate lib/sanitizer_common/sanitizer_platform_limits_netbsd.h that is a public header for applications, and included as: <sanitizer_common/sanitizer_platform_limits_netbsd.h>. Generate sanitizer_syscalls_netbsd.inc that defines all the syscall rules for NetBSD. This file is modeled after the Linux specific file: sanitizer_common_syscalls.inc. Start recognizing NetBSD syscalls with existing sanitizers: ASan, ESan, HWASan, TSan, MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, dvyukov, eugenis Reviewed By: vitalybuka Subscribers: hintonda, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42048 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325206 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15Add new interceptor: lstat(2)Kamil Rytarowski
Summary: lstat - get file status Use it on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42909 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325199 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-13[libFuzzer] Set -experimental_len_control=1000 as default.Matt Morehouse
Summary: Experiments using https://github.com/google/fuzzer-test-suite/tree/master/engine-comparison show a significant increase in coverage and reduction in corpus size with this option enabled. Addresses https://llvm.org/pr36371. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42932 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325050 91177308-0d34-0410-b5e6-96231b3b80d8