summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* Add new NetBSD interceptors: devname(3), devname_r(3)Kamil Rytarowski2018-02-022-0/+49
| | | | | | | | | | | | | | | | | | | Summary: devname, devname_r - get device name Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42053 llvm-svn: 324120
* Add new interceptors: strlcpy(3) and strlcat(3)Kamil Rytarowski2018-02-012-0/+104
| | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD ships with strlcpy(3) and strlcat(3), a safe replacement of strcpy(3) and strcat(3). Hide both functions under SANITIZER_INTERCEPT_STRLCPY. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42061 llvm-svn: 324034
* [sanitizer] Fix array sizes used for path in testsVitaly Buka2018-02-012-17/+5
| | | | llvm-svn: 324022
* Update readlink.c and readlinkat.c to use larger buffers on Darwin.Kuba Mracek2018-02-012-5/+17
| | | | llvm-svn: 324016
* [sanitizer] Move readlinkat.c test from Linux to PosixVitaly Buka2018-01-311-0/+0
| | | | llvm-svn: 323837
* [sanitizer] Fix tests on Android and DarwinVitaly Buka2018-01-303-7/+8
| | | | llvm-svn: 323834
* [sanitizer] Add interceptors for readlinkat, name_to_handle_at, ↵Vitaly Buka2018-01-303-0/+77
| | | | | | | | | | | | | | | | | | | | | open_by_handle_at Summary: Also move existing readlink msan interceptor to sanitizer_common. Fixes google/sanitizers#908 Patch by Oliver Chang Reviewers: vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42630 llvm-svn: 323825
* Add a new interceptor: paccept(2)Kamil Rytarowski2018-01-231-0/+74
| | | | | | | | | | | | | | | | | | | 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
* Enable sanitizer_common tests on NetBSDKamil Rytarowski2018-01-183-3/+14
| | | | | | | | | | | | | | | | | | 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
* Add new NetBSD interceptors: getgrouplist(3) & getgroupmembership(3)Kamil Rytarowski2018-01-182-0/+59
| | | | | | | | | | | | | | | | | | | 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
* Add new interceptors: access(2), faccessat(2)Kamil Rytarowski2018-01-182-0/+11
| | | | | | | | | | | | | | | | | | | 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
* Add new interceptors for pwcache(3)-style functionsKamil Rytarowski2018-01-184-0/+66
| | | | | | | | | | | | | | | | | | | | | 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
* [Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)Kamil Rytarowski2018-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [Sanitizers] Export aligned new/delete from runtimes.Alex Shlyapnikov2017-12-231-3/+3
| | | | | | | | | | | | | | | | Summary: Export aligned new/delete to make dynamic runtimes work again. Remove all valid new/delete cases from ASan test, there's a test in common for that. Reviewers: eugenis Subscribers: srhines, kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41548 llvm-svn: 321394
* [Sanitizers] Disable new_delete_test.cc on Android until it's supported.Alex Shlyapnikov2017-12-221-2/+2
| | | | llvm-svn: 321374
* [MSan,TSan] Add aligned new/delete interceptors.Alex Shlyapnikov2017-12-221-0/+80
| | | | | | | | | | | | | | | Summary: Providing aligned new/delete implementations to match ASan. Unlike ASan, MSan and TSan do not perform any additional checks on overaligned memory, hence no sanitizer specific tests. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41532 llvm-svn: 321365
* [sanitizer] Simplify android_run.py.Evgeniy Stepanov2017-12-071-1/+1
| | | | | | | A test-only change to pass all *SAN_OPTIONS to the device without listing them individually. llvm-svn: 319998
* [ubsan] Re-commit: lit changes for lld testing, future lto testing.Roman Lebedev2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. The original attempt, r319525 was reverted in r319526 due to the failures in compiler-rt standalone builds. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 llvm-svn: 319575
* Revert "[ubsan] lit changes for lld testing, future lto testing."Roman Lebedev2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit r319525. This change has introduced a problem with the Lit tests build for compiler-rt using Gold: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/6047/steps/test%20standalone%20compiler-rt/logs/stdio llvm-lit: /b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py:101: fatal: unable to parse config file '/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg', traceback: Traceback (most recent call last): File "/b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py", line 88, in load_from_path exec(compile(data, path, 'exec'), cfg_globals, None) File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 37, in <module> if root.host_os not in ['Linux'] or not is_gold_linker_available(): File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 27, in is_gold_linker_available stderr = subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory llvm-svn: 319529
* [ubsan] lit changes for lld testing, future lto testing.Roman Lebedev2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 llvm-svn: 319525
* [tsan] Fix sigaction implementation when it's called only to get handlerVitaly Buka2017-11-201-3/+12
| | | | | | | | | | Reviewers: eugenis Subscribers: kubamracek, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40272 llvm-svn: 318707
* [sanitizer] Relax stack check in assert.cc even moreVitaly Buka2017-11-131-1/+0
| | | | | | assert implementations can be very different llvm-svn: 318089
* [tsan] Fix signal chainingVitaly Buka2017-11-131-4/+0
| | | | | | | | | | | | Summary: Return saved values only if installed sigaction is our wrapper. Reviewers: eugenis, dvyukov Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39935 llvm-svn: 318082
* [tsan] Deadly signal handler for tsanVitaly Buka2017-11-136-15/+0
| | | | | | | | | | | | Summary: https://github.com/google/sanitizers/issues/637 Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39929 llvm-svn: 318078
* [sanitizer] Relax stack checkVitaly Buka2017-11-131-1/+1
| | | | | | -NEXT sometimes does not work as LLVMSymbolizer warning can appear there. llvm-svn: 318077
* [sanitizer] Simplify stack check in accert.ccVitaly Buka2017-11-121-2/+2
| | | | | | Somehow on arm bots stack does not include main. llvm-svn: 318002
* [sanitizer] Try to see test output on armv7Vitaly Buka2017-11-121-0/+1
| | | | llvm-svn: 318001
* [msan] Fix signal chainingVitaly Buka2017-11-111-3/+3
| | | | | | Return internally stored handlers only if handlers is set to wrapper llvm-svn: 317970
* [sanitizer] Include stack trace check into signal testsVitaly Buka2017-11-113-3/+12
| | | | llvm-svn: 317963
* [ubsan] Fix ubsan tests broken by linking as C instead of C++Vitaly Buka2017-11-112-6/+5
| | | | llvm-svn: 317958
* [msan] Deadly signal handler for msanVitaly Buka2017-11-106-6/+0
| | | | | | | | | | | | Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39826 llvm-svn: 317864
* Revert "[asan] Deflake one test by running it 3 times."Evgeniy Stepanov2017-10-171-18/+3
| | | | | | Disable this test on Android/x86 only. llvm-svn: 316023
* [asan] Deflake one test by running it 3 times.Evgeniy Stepanov2017-10-131-3/+18
| | | | | | The test seems to trigger an android platform bug under load. llvm-svn: 315777
* [sanitizer] Workaround a Linux kernel bug in hard_rss_limit_mb_test.Evgeniy Stepanov2017-10-121-7/+6
| | | | llvm-svn: 315632
* [asan] Disable a flaky test on android.Evgeniy Stepanov2017-10-121-0/+3
| | | | llvm-svn: 315602
* [asan] Tweak test output to diagnose buildbot failures.Evgeniy Stepanov2017-10-111-2/+6
| | | | llvm-svn: 315479
* [sanitizer] Re-disable several tests on Android.Evgeniy Stepanov2017-10-116-6/+6
| | | | | | The tests have been enabled by accident in r315389. llvm-svn: 315396
* Factor out "stable-runtime" feature and enable it on all android.Evgeniy Stepanov2017-10-101-3/+0
| | | | | | | This is a very poorly named feature. I think originally it meant to cover linux only, but the use of it in msan seems to be about any aarch64 platform. Anyway, this change should be NFC on everything except Android. llvm-svn: 315389
* [sanitizer] Test ubsan and cfi on android.Evgeniy Stepanov2017-10-061-1/+1
| | | | | | | | | | | | | | | Summary: Enable check-cfi and check-ubsan on Android. Check-ubsan includes standalone and ubsan+asan, but not tsan or msan. Cross-dso cfi tests are disabled for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38608 llvm-svn: 315105
* [asan] Use full binary path in the Android test runner.Evgeniy Stepanov2017-10-052-4/+8
| | | | | | | | | | | | | | Summary: This prevents the confusion when there are similarly named tests in different configurations (like in test/sanitizer_common). Reviewers: vitalybuka Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D38526 llvm-svn: 315011
* [mips][compiler-rt] Disable sem_init_glibc.cc for MIPS64.Simon Dardis2017-09-251-1/+1
| | | | | | | | | | | This test can't pass on MIPS64 due to the lack of versioned interceptors for asan and company. The interceptors bind to the earlier version of sem_init rather than the latest version. For MIPS64el this causes an accidental pass while MIPS64 big endian fails due reading back a different 32bit word to what sem_init wrote when the test is corrected to use 64bit atomics. llvm-svn: 314100
* [ubsan] Fix assert.cc test by compiling it as C++Vitaly Buka2017-09-231-2/+1
| | | | llvm-svn: 314057
* [ubsan] Support signal specific options in ubsanVitaly Buka2017-09-234-5/+1
| | | | | | | | | | | | | | | | Summary: Part of https://github.com/google/sanitizers/issues/637 Standalone ubsan needs signal and sigaction handlers and interceptors. Plugin mode should rely on parent tool. Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D37895 llvm-svn: 314052
* [lsan] Deadly signal handler for lsanVitaly Buka2017-09-227-9/+7
| | | | | | | | | | | | Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, dberris, kubamracek, krytarowski Differential Revision: https://reviews.llvm.org/D37608 llvm-svn: 314041
* [mips][compiler-rt] UnXFAIL test.Simon Dardis2017-09-191-2/+0
| | | | | | lsan and asan were reporting leaks caused by a glibc configuration issue. llvm-svn: 313645
* [scudo] Additional modifications for Android tests supportKostya Kortchinsky2017-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With the recent move of `android_commands` to `sanitizer_common`, some things have to be updated with regard to Scudo on Android. Notably: - `config.android` is dealt with in the common code - `config.compile_wrapper` can be prepended to allow for the use of the android commands - `SCUDO_OPTIONS` must be passed with the environment when running a test - `preinit.cpp` fails with some API levels, not sure why, I will have to dig into this later. Note that `check-scudo` is not enabled yet in the bots. It's all local testing for now until everything looks good. Reviewers: alekseyshl, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D37990 llvm-svn: 313561
* [sanitizer] Fix check for i386 Android in lit testsVitaly Buka2017-09-166-6/+6
| | | | llvm-svn: 313452
* [sanitizer] Disable sanitizer test which already fails on Android i386Vitaly Buka2017-09-166-9/+17
| | | | llvm-svn: 313447
* [sanitizer] Support check-asan on AndroidVitaly Buka2017-09-169-8/+31
| | | | | | This patch enabled asan tests from sanitizer_common. llvm-svn: 313444
* [sanitizer] Move android_commoands from asan into sanitizer_commonVitaly Buka2017-09-163-0/+117
| | | | llvm-svn: 313443
OpenPOWER on IntegriCloud