- Jan 23, 2018
-
-
Kamil Rytarowski authored
Summary: paccept(2) is a NetBSD-specific variation of accept(2). Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42052 llvm-svn: 323273
-
Francis Ricci authored
Summary: Now that ubsan does function interception (for signals), we need to ensure that ubsan is initialized before any library constructors are called. Otherwise, if a constructor calls sigaction, ubsan will intercept in an unitialized state, which will cause a crash. This patch is a partial revert of r317757, which removed preinit arrays for ubsan. Reviewers: vitalybuka, eugenis, pcc Subscribers: kubamracek, mgorny, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42389 llvm-svn: 323249
-
Bill Seurer authored
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 fixes up a test case that was found to fail on some newer Fedora releases that use different address ranges. ref: https://reviews.llvm.org/D40907 llvm-svn: 323217
-
Alex Shlyapnikov authored
Summary: One test-case uses a wrong operation (should be subtraction). Second test-case should declare a global variables before a tested one in order to guarantee we will find a red-zone. Reviewers: kcc, jakubjelinek, alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D41481 llvm-svn: 323162
-
- Jan 22, 2018
-
-
Evgeniy Stepanov authored
Summary: See rationale in the comments. Reviewers: vitalybuka Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D42329 llvm-svn: 323142
-
Maxim Ostapenko authored
Differential Revision: https://reviews.llvm.org/D42303 llvm-svn: 323083
-
Hiroshi Inoue authored
"the the" -> "the" llvm-svn: 323080
-
- Jan 21, 2018
-
-
Petr Hosek authored
This addresses the error introduced in r323054 on some bots. llvm-svn: 323061
-
Petr Hosek authored
add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323054
-
- Jan 20, 2018
-
-
Kamil Rytarowski authored
Summary: Make __clear_cache() invoke the platform's cache flush function on OpenBSD/mips64. Reviewers: krytarowski Reviewed By: krytarowski Subscribers: sdardis, dberris, arichardson, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42332 llvm-svn: 323039
-
Petr Hosek authored
This reverts commit r323032: failing on the sanitizer-x86_64-linux-autoconf bot. llvm-svn: 323033
-
Petr Hosek authored
add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323032
-
Petr Hosek authored
This triggers compiler error when building sanitizers for Fuchsia. Differential Revision: https://reviews.llvm.org/D42328 llvm-svn: 323029
-
Petr Hosek authored
This reverts commit r323027: it breaks the SanitizerLintCheck. llvm-svn: 323028
-
Petr Hosek authored
This triggers compiler error when building sanitizers for Fuchsia. Differential Revision: https://reviews.llvm.org/D42328 llvm-svn: 323027
-
Dan Liew authored
sequentially. The current implementation of commands in `test/sanitizer_common/ios_commands/` for iOS devices cannot be executed in parallel which results in the ASan and TSan tests failing when executed in parallel by lit which was the default behaviour. We now force the ASan and TSan tests to be a new parallelism group named `darwin-ios-device-sanitizer` which allows only one test to be run at a time. We also emit a warning informing the user that tests are being run sequentially. This only applies if the target is an iOS device. Differential Revision: https://reviews.llvm.org/D42156 llvm-svn: 323026
-
Kamil Rytarowski authored
Summary: The localtime symbol is mangled to __locatime50 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/D42045 llvm-svn: 323019
-
Kamil Rytarowski authored
Summary: The accept4() function first appeared in NetBSD 8.0. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, srhines, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42046 llvm-svn: 323018
-
Petar Jovanovic authored
MemToShadowImpl() maps lower addresses to a memory space out of sanitizers range. The simplest example is address 0 which is mapped to 0x2000000000 static const uptr kShadowBeg = 0x2400000000ull; but accessing the address during tsan execution will lead to a segmentation fault. This patch expands the range used by the sanitizer and ensures that 1/8 of the maximum valid address in the virtual address spaces is used for shadow memory. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D41777 llvm-svn: 323013
-
- Jan 19, 2018
-
-
Kostya Kortchinsky authored
Summary: Fuchsia has `getauxval` (https://fuchsia.googlesource.com/zircon/+/master/third_party/ulib/musl/include/sys/auxv.h, https://fuchsia.googlesource.com/zircon/+/master/third_party/ulib/musl/src/misc/getauxval.c) so set SANITIZER_USE_GETAUXVAL to 1 for this platform. Reviewers: alekseyshl, flowerhack Reviewed By: flowerhack Subscribers: srhines, kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42315 llvm-svn: 323002
-
Kostya Kortchinsky authored
Summary: We somehow never did it, and it raised no issue until now, when trying to enable Fuchsia as a supported Scudo platform in the cmake config. So propagate SANITIZER_COMMON_LINK_FLAGS for now. Reviewers: alekseyshl, flowerhack Reviewed By: flowerhack Subscribers: mgorny, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42314 llvm-svn: 322999
-
Petr Hosek authored
It was always intended to be. Patch By: mcgrathr Differential Revision: https://reviews.llvm.org/D41513 llvm-svn: 322991
-
Kamil Rytarowski authored
llvm-svn: 322947
-
Martin Pelikan authored
Summary: While there, unify InMemoryRawLog and InMemoryRawLogWithArg's coding style: - swap libc's memcpy(3) for sanitizer's internal memcpy - use basic pointer arithmetics to compute offsets from the first record entry in the pre-allocated buffer, which is always the appropriate type for the given function - lose the local variable references as the TLD.* names fit just as well Reviewers: eizan, kpw, dberris, dblaikie Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42289 llvm-svn: 322941
-
Martin Storsjö authored
Generalize this handling to a separate toplevel ifdef (since any windows case should use the same function), instead of indenting the aarch64 case one step further. Differential Revision: https://reviews.llvm.org/D42197 llvm-svn: 322928
-
- Jan 18, 2018
-
-
Kostya Kortchinsky authored
Summary: Tests were being run by whole-linking the static library with our test binaries. But since `-fsanitize=scudo` landed with rL317337, we might as well change how the tests are compiled to use it. The only difference will be on Android, where the clang flag links in the dynamic library instead, but the bots are already pushing `libclang_rt.*-android.so` to the device there is no additional change needed. Tested locally, including with a standalone build, and an Android one on a O device, and it all passes. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42243 llvm-svn: 322882
-
Kamil Rytarowski authored
Summary: NetBSD can handle asan, ubsan, msan, tsan tests on 64-bit and when applicable 32-bit X86 OS. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Subscribers: srhines, llvm-commits, kubamracek, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42236 llvm-svn: 322842
-
Kamil Rytarowski authored
This should restore the rule of <=80 characters per line. llvm-svn: 322841
-
Kamil Rytarowski authored
Summary: getgrouplist, getgroupmembership -- calculate group access list Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42064 llvm-svn: 322836
-
Kamil Rytarowski authored
Summary: access, faccessat - check access permissions of a file or pathname Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42065 llvm-svn: 322831
-
Kamil Rytarowski authored
Summary: From <pwd.h>: user_from_uid, uid_from_user From <grp.h>: group_from_gid, gid_from_group Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42068 llvm-svn: 322829
-
Alex Shlyapnikov authored
Converting a few failure handler calls missed in D42198. llvm-svn: 322793
-
Alex Shlyapnikov authored
Summary: Make common allocator agnostic to failure handling modes and move the decision up to the particular sanitizer's allocator, where the context is available (call stack, parameters, return nullptr/crash mode etc.) It simplifies the common allocator and allows the particular sanitizer's allocator to generate more specific and detailed error reports (which will be implemented later). The behavior is largely the same, except one case, the violation of the common allocator's check for "size + alignment" overflow is now reportied as OOM instead of "bad request". It feels like a worthy tradeoff and "size + alignment" is huge in this case anyway (thus, can be interpreted as not enough memory to satisfy the request). There's also a Report() statement added there. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42198 llvm-svn: 322784
-
Kostya Kortchinsky authored
Summary: A forgotten include in `scudo_allocator.cpp` made the symbol only local :/ Before: ``` nm ./lib/clang/7.0.0/lib/linux/libclang_rt.scudo-i686-android.so | grep rss 00024730 t __scudo_set_rss_limit ``` After: ``` nm ./lib/clang/7.0.0/lib/linux/libclang_rt.scudo-i686-android.so | grep rs 00024760 T __scudo_set_rss_limit ``` And we want `T`! This include also means that we can get rid of the `extern "C"` in the C++ file, the compiler does fine without it (note that this was already the case for all the `__sanitizer_*` interface functions. Reviewers: alekseyshl, eugenis Reviewed By: eugenis Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42199 llvm-svn: 322782
-
- Jan 17, 2018
-
-
Kostya Kortchinsky authored
Summary: jemalloc on Android currently uses 2 arenas (https://android.googlesource.com/platform/external/jemalloc/+/master/Android.bp#64). Since the Android toolchain absorbs compiler-rt and compiles it as is, we have to enforce the same limit to somehow stay competitive in terms of memory usage. The changes could either go in: - `scudo_platform.h` with a default for Android of 2 (this is the solution implemented here); - in `CMakeLists.txt` adding -DSCUDO_SHARED_TSD_POOL_SIZE=2 for Android. - something else? I don't have a strong opinion on how to do it, but it has to be done upstream anyway. Reviewers: alekseyshl, eugenis Reviewed By: alekseyshl, eugenis Subscribers: srhines, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42194 llvm-svn: 322764
-
Petr Hosek authored
This is needed in case the users of libFuzzer use libc++ in their code, which the fuzz target (libFuzzer) will be linked against. When libc++ source is available, we build a private version of it and link it against libFuzzer which allows using the same static library against codebases which use both libc++ and libstdc++. Differential Revision: https://reviews.llvm.org/D37631 llvm-svn: 322755
-
Petr Hosek authored
This reverts commit r322604: test is failing for standalone compiler-rt. llvm-svn: 322689
-
Kamil Rytarowski authored
Summary: acct - enable or disable process accounting Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42066 llvm-svn: 322646
-
Kamil Rytarowski authored
Add missing endif. llvm-svn: 322638
-
Kamil Rytarowski authored
Summary: This patch (on top of the previous two (https://reviews.llvm.org/D40898 and https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris sanitizer port. It contains the following sets of changes: * For the time being, the port is for 32-bit x86 only, so reject the various tests on x86_64. * When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares _setjmp and _longjmp inside namespace std. * MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a no-op compat define, Solaris does not. * test/asan/TestCases/Posix/coverage.cc was initially failing like this: /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument Further digging revealed that the rm was trying to remove the running test's working directory which failed as observed. cd'ing out of the dir before let the test pass. * Two tests needed a declaration of alloca. I've now copied the existing code from test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and maintainable to have a common testsuite header where such code is collected. * Similarly, Solaris' printf %p format doesn't include the leading 0x. * In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__ (predefined by clang for no apparent reason) to avoid conflicting declarations for memalign. * test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and friends as predefined by clang and gcc? Patch by Rainer Orth. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40900 llvm-svn: 322635
-