summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sanitizer] capsicum api subset interceptionDavid Carlier2018-12-081-0/+48
| | | | | | | | | | | | - For the moment a subset of this api dealing with file descriptors permissions and ioctls. Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D55368 llvm-svn: 348668
* Add interceptors for the strtoi(3)/strtou(3) from NetBSDKamil Rytarowski2018-12-071-0/+43
| | | | | | | | | | | | | | | | | | | | | | | Summary: strtoi/strtou converts string value to an intmax_t/uintmax_t integer. Add a dedicated test. Enable this API for NetBSD. It's a reworked version of the original work by Yang Zheng. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, tomsun.0.7, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54702 llvm-svn: 348663
* Add a new interceptors for statvfs1(2) and fstatvfs1(2) from NetBSDKamil Rytarowski2018-12-071-0/+58
| | | | | | | | | | | | | | | | | | | | | Summary: statvfs1, fstatvfs1 - get file system statistics. While there, use file descriptor related macros in the fstatvfs interceptor. Add a dedicated test. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: dvyukov, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55031 llvm-svn: 348656
* Add a new interceptor for fparseln(3) from NetBSDKamil Rytarowski2018-12-071-0/+25
| | | | | | | | | | | | | | | | | | | Summary: fparseln - returns the next logical line from a stream. Add a dedicated test for this API. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55019 llvm-svn: 348654
* Add new interceptor for strtonum(3)Kamil Rytarowski2018-12-071-0/+52
| | | | | | | | | | | | | | | | | | | | | | | Summary: strtonum(3) reliably convertss string value to an integer. This function is used in OpenBSD compat namespace and is located inside NetBSD's libc. Add a dedicated test for this interface. It's a reworked version of the original code by Yang Zheng. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: tomsun.0.7, kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54527 llvm-svn: 348651
* [Sanitizer] getmntinfo support in FreeBSDDavid Carlier2018-12-061-0/+10
| | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55354 llvm-svn: 348500
* Remove XFAIL in get_module_and_offset_for_pc.cc for NetBSD-MSanKamil Rytarowski2018-12-051-1/+0
| | | | | | | After updating GET_LINK_MAP_BY_DLOPEN_HANDLE() for recent NetBSD this test no longer fails. llvm-svn: 348378
* [Sanitizer] expand nl_langinfo interception to FreeBSDDavid Carlier2018-12-051-0/+2
| | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55327 llvm-svn: 348376
* Add a new interceptor for nl_langinfo(3) from NetBSDKamil Rytarowski2018-12-051-0/+18
| | | | | | | | | | | | | | | | | | | Summary: nl_langinfo - gets locale information. Add a dedicated test. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55015 llvm-svn: 348369
* [asan] Add clang flag -fsanitize-address-use-odr-indicatorVitaly Buka2018-12-051-0/+5
| | | | | | | | | | Reviewers: eugenis, m.ostapenko, ygribov Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D55157 llvm-svn: 348327
* [asan] Split -asan-use-private-alias to -asan-use-odr-indicatorVitaly Buka2018-12-041-1/+6
| | | | | | | | | | Reviewers: eugenis, m.ostapenko, ygribov Subscribers: mehdi_amini, kubamracek, hiraditya, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D55156 llvm-svn: 348316
* [asan] Remove use_odr_indicator runtime flagVitaly Buka2018-12-043-6/+4
| | | | | | | | | | | | | | Summary: Flag was added for testing 3 years ago. Probably it's time to simplify code and usage by removing it. Reviewers: eugenis, m.ostapenko Subscribers: mehdi_amini, kubamracek, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D55254 llvm-svn: 348315
* Fix sanitizer unit testDavid Carlier2018-12-041-1/+1
| | | | llvm-svn: 348297
* [Sanitizer] intercept part of sysctl ApiDavid Carlier2018-12-041-18/+29
| | | | | | | | | | | | | - Distringuish what FreeBSD/NetBSD can and NetBSD specifics. - Fixing page size value collection. Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D55265 llvm-svn: 348293
* Add interceptors for the sysctl(3) API family from NetBSDKamil Rytarowski2018-12-041-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add new interceptors for: - sysctl - sysctlbyname - sysctlgetmibinfo - sysctlnametomib - asysctl - asysctlbyname Cover the API with a new test file TestCases/NetBSD/sysctl.cc. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: devnexen, kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54076 llvm-svn: 348228
* Add interceptors for the fts(3) API family from NetBSDKamil Rytarowski2018-12-041-0/+40
| | | | | | | | | | | | | | | | | | | | | | | Summary: fts(3) is API to traverse a file hierarchy. Cover this interface with interceptors. Add a test to validate the interface reading the number of regular files in /etc. Based on original work by Yang Zheng. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: tomsun.0.7, kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54247 llvm-svn: 348227
* Add new interceptor for regex(3) in NetBSDKamil Rytarowski2018-12-041-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add interceptors for the NetBSD style of regex(3) present inside libc: - regcomp - regexec - regerror - regfree - regnsub - regasub Add a dedicated test verifying the installed interceptors. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54584 llvm-svn: 348224
* [gcov/Darwin] Ensure external symbols are exported when using an export listVedant Kumar2018-12-031-0/+8
| | | | | | | | | | | | | | Make sure that symbols needed to implement runtime support for gcov are exported when using an export list on Darwin. Without the clang driver exporting these symbols, the linker hides them, resulting in tapi verification failures. rdar://45944768 Differential Revision: https://reviews.llvm.org/D55151 llvm-svn: 348187
* Introduce a way to allow the ASan dylib on Darwin platforms to be loaded via ↵Dan Liew2018-12-012-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `dlopen()`. Summary: The purpose of this option is provide a way for the ASan dylib to be loaded via `dlopen()` without triggering most initialization steps (e.g. shadow memory set up) that normally occur when the ASan dylib is loaded. This new functionality is exposed by - A `SANITIZER_SUPPORTS_INIT_FOR_DLOPEN` macro which indicates if the feature is supported. This only true for Darwin currently. - A `HandleDlopenInit()` function which should return true if the library is being loaded via `dlopen()` and `SANITIZER_SUPPORTS_INIT_FOR_DLOPEN` is supported. Platforms that support this may perform any initialization they wish inside this function. Although disabling initialization is something that could potentially apply to other sanitizers it appears to be unnecessary for other sanitizers so this patch only makes the change for ASan. rdar://problem/45284065 Reviewers: kubamracek, george.karpenkov, kcc, eugenis, krytarowski Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D54469 llvm-svn: 348078
* [compiler-rt] Use "ColumnLimit: 0" instead of "clang-format off" in testsVitaly Buka2018-12-017-12/+2
| | | | | | | | | | Reviewers: eugenis, jfb Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D55152 llvm-svn: 348061
* Add a new interceptor for getvfsstat(2) from NetBSDKamil Rytarowski2018-11-301-0/+36
| | | | | | | | | | | | | | | | | | | Summary: getvfsstat - gets list of all mounted file systems. Add a dedicated test. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55014 llvm-svn: 348027
* Revert r346560 "[winasan] Unpoison the stack in NtTerminateThread"Reid Kleckner2018-11-291-1/+0
| | | | | | | | | | | This reverts r343606 again. The NtTerminateThread interceptor is causing problems in NaCl: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/CrWinAsan/1839 I reproduced the problem locally and tried my best to debug them, but it's beyond me. llvm-svn: 347933
* [gcov] Disable instrprof-gcov-fork.test.Matt Morehouse2018-11-281-0/+2
| | | | | | Test has been flaky for over a week and author hasn't fixed. llvm-svn: 347779
* [Sanitizer] Adding setvbuf in supported platforms and other stream buffer ↵David Carlier2018-11-211-0/+14
| | | | | | | | | | | | | | | functions - Enabling setvbuf interceptions for non NetBSD platforms. - setbuf, setbuffer, setlinebuf as well. Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D54779 llvm-svn: 347426
* [compiler-rt][UBSan] silence_unsigned_overflow: do *NOT* ignore *fatal* ↵Roman Lebedev2018-11-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unsigned overflows Summary: D48660 / rL335762 added a `silence_unsigned_overflow` env flag for [[ https://github.com/google/oss-fuzz/pull/1717 | oss-fuzz needs ]], that allows to silence the reports from unsigned overflows. It makes sense, it is there because `-fsanitize=integer` sanitizer is not enabled on oss-fuzz, so this allows to still use it as an interestingness signal, without getting the actual reports. However there is a slight problem here. All types of unsigned overflows are ignored. Even if `-fno-sanitize-recover=unsigned` was used (which means the program will die after the report) there will still be no report, the program will just silently die. At the moment there are just two projects on oss-fuzz that care: * [[ https://github.com/google/oss-fuzz/blob/8eeffa627f937040aaf8ba1b7d93f43f77d74fb9/projects/llvm_libcxx/build.sh#L18-L20 | libc++ ]] * [[ https://github.com/google/oss-fuzz/blob/8eeffa627f937040aaf8ba1b7d93f43f77d74fb9/projects/librawspeed/build.sh | RawSpeed ]] (me) I suppose this could be overridden there ^, but i really don't think this is intended behavior in any case.. Reviewers: kcc, Dor1s, #sanitizers, filcab, vsk, kubamracek Reviewed By: Dor1s Subscribers: dberris, mclow.lists, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54771 llvm-svn: 347415
* tsan: add pthread_tryjoin_np and pthread_timedjoin_np interceptorsDmitry Vyukov2018-11-212-0/+80
| | | | | | | | | | Add pthread_tryjoin_np() and pthread_timedjoin_np() interceptors on Linux, so that ThreadSanitizer can handle programs using these functions. Author: Yuri Per (yuri) Reviewed in: https://reviews.llvm.org/D54521 llvm-svn: 347383
* Add header <atomic> which is needed to compile with some older library versions.Douglas Yung2018-11-211-0/+1
| | | | llvm-svn: 347382
* [XRay] Add a test for re-initialising FDR mode (NFC)Dean Michael Berris2018-11-211-0/+72
| | | | | | | This change adds an end-to-end test that ensures FDR mode can be re-initialised safely in the face of multiple threads being traced. llvm-svn: 347368
* Revert "[Sanitizer] intercept setvbuf on other platforms where it is supported"David Carlier2018-11-201-8/+0
| | | | llvm-svn: 347358
* [Sanitizer] Unbreak non NetBSD builds.David Carlier2018-11-201-0/+2
| | | | llvm-svn: 347357
* [Sanitizer] intercept setvbuf on other platforms where it is supportedDavid Carlier2018-11-201-2/+6
| | | | | | | | | | | | Unit tests enabled only in platform tested. Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski, vitalybuka Differential Revision: https://reviews.llvm.org/D54739 llvm-svn: 347355
* [tsan] Add __cxa_guard_acquire hooks to support cooperative schedulingVitaly Buka2018-11-201-0/+25
| | | | | | | | | | Reviewers: dvyukov Subscribers: krytarowski, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D54664 llvm-svn: 347336
* Add interceptor for the setvbuf(3) from NetBSDKamil Rytarowski2018-11-191-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | Summary: setvbuf(3) is a routine to setup stream buffering. Enable the interceptor for NetBSD. Add dedicated tests for setvbuf(3) and functions on top of this interface: setbuf, setbuffer, setlinebuf. Based on original work by Yang Zheng. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: devnexen, tomsun.0.7, kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54548 llvm-svn: 347270
* [hwasan] make the heap-buffer-overflow.c test more robust and re-enable it. ↵Kostya Serebryany2018-11-171-3/+3
| | | | | | With malloc_align_right the relative offsets of heap chunks are less predictable to simply don't test for them. llvm-svn: 347118
* [hwasan] implement free_checks_tail_magic=1Kostya Serebryany2018-11-171-0/+28
| | | | | | | | | | | | | | | | | | | | | | | Summary: With free_checks_tail_magic=1 (default) HWASAN writes magic bytes to the tail of every heap allocation (last bytes of the last granule, if the last granule is not fully used) and checks these bytes on free(). This feature will detect buffer overwires within the last granule at the time of free(). This is an alternative to malloc_align_right=[1289] that should have fewer compatibility issues. It is also weaker since it doesn't detect read overflows and reports bugs at free() instead of at access. Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D54656 llvm-svn: 347116
* [hwasan] use reads instead of writes in a testKostya Serebryany2018-11-161-1/+3
| | | | llvm-svn: 347107
* [hwasan] disable one test line while investigating a bot failureKostya Serebryany2018-11-161-1/+1
| | | | llvm-svn: 347091
* Add new interceptor for mi_vector_hash(3)Kamil Rytarowski2018-11-161-0/+19
| | | | | | | | | | | | | | | | | | | | | | | Summary: mi_vector_hash(3) provides fast 32bit hash functions. Add a test for this interface. Enable the API for NetBSD. Based on original work by Yang Zheng. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: tomsun.0.7, kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54530 llvm-svn: 347088
* Add new interceptor for getmntinfo(3) from NetBSDKamil Rytarowski2018-11-161-0/+25
| | | | | | | | | | | | | | | | | | | | | Summary: getmntinfo gets information about mounted file systems. Add a dedicated test for new interceptor. Based on original work by Yang Zheng. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: tomsun.0.7, kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54611 llvm-svn: 347083
* [hwasan] optionally right-align heap allocationsKostya Serebryany2018-11-163-8/+67
| | | | | | | | | | | | | | | | | Summary: ... so that we can find intra-granule buffer overflows. The default is still to always align left. It remains to be seen wether we can enable this mode at scale. Reviewers: eugenis Reviewed By: eugenis Subscribers: jfb, dvyukov, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D53789 llvm-svn: 347082
* Re-land r343606 "[winasan] Unpoison the stack in NtTerminateThread"Reid Kleckner2018-11-091-0/+1
| | | | | | | | | This change was reverted because it caused some nacl tests in chromium to fail. I attempted to reproduce those problems locally, but I was unable to. Let's reland this and let Chromium's test infrastructure discover any problems. llvm-svn: 346560
* [hwasan] Add entire report to abort message on Android.Evgeniy Stepanov2018-11-091-0/+28
| | | | | | | | | | | | | | Summary: When reporting a fatal error, collect and add the entire report text to android_set_abort_message so that it can be found in the tombstone. Reviewers: kcc, vitalybuka Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D54284 llvm-svn: 346557
* [Profile] The test for gcov-fork seems to be ok on armCalixte Denizet2018-11-081-2/+0
| | | | | | | | | | | | | | Summary: Remove the XFAIL for arm since it seems to be ok Reviewers: marco-c Reviewed By: marco-c Subscribers: javed.absar, kristof.beyls, delcypher, chrib, llvm-commits, #sanitizers, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D54263 llvm-svn: 346409
* [Profile] Mark gcov-fork test as failing for armCalixte Denizet2018-11-071-0/+2
| | | | | | | | | | | | | | Summary: instrprof-gcov-fork.test is failing with arm so mark it as XFAIL Reviewers: marco-c Reviewed By: marco-c Subscribers: javed.absar, kristof.beyls, delcypher, chrib, llvm-commits, sylvestre.ledru, #sanitizers Differential Revision: https://reviews.llvm.org/D54209 llvm-svn: 346329
* [Profile] Fix fork test and add tests for execlp and execvp after patch ↵Calixte Denizet2018-11-078-4/+102
| | | | | | | | | | | | | | | | https://reviews.llvm.org/D53593 Summary: This is a follow-up of patch https://reviews.llvm.org/D53593 Reviewers: marco-c Reviewed By: marco-c Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D54167 llvm-svn: 346314
* [GCOV] Close file mapping handle on Windows, so flushed gcda files can be ↵Marco Castelluccio2018-11-073-0/+47
| | | | | | removed while the process is in execution llvm-svn: 346300
* [sanitizer] Only set soft coredump limit.Evgeniy Stepanov2018-11-071-1/+1
| | | | | | | | | | | | Summary: If user wants to raise it back, let them. Reviewers: kcc, vitalybuka Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D54190 llvm-svn: 346284
* [fuzzer] Read files as binaryJonathan Metzman2018-11-062-0/+25
| | | | | | | | | | | | Summary: Read corpus files as binary to avoid automatic conversions Reviewers: Dor1s, morehouse Reviewed By: Dor1s, morehouse Differential Revision: https://reviews.llvm.org/D54180 llvm-svn: 346279
* [Darwin] Export new weak external symbols when compiling with coverageVedant Kumar2018-11-061-0/+8
| | | | | | | | | | | Some weak external symbols were added to the profile runtime in D49953, and on Darwin, these need to be exported for tapi verification purposes. I've tightened the test so that future breakages can be caught earlier. rdar://45831054 llvm-svn: 346276
* Adapt UBSan integer truncation tests to NetBSDKamil Rytarowski2018-11-0610-198/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The NetBSD headers use internal indirect type for standard *int*_t definitions. The internal type is unrolled inside the sanitizer into e.g. __int32_t from int32_t. This symbol mangling causes pattern mismatch in the interger truncation tests as they expect exact types such as 'int32_t'. Change the pattern rules so every acceptable internal form of *int*_t will be accepted flawlessly. Reviewers: lebedev.ri, vitalybuka, joerg Reviewed By: lebedev.ri Subscribers: kubamracek, dmgreen, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54150 llvm-svn: 346228
OpenPOWER on IntegriCloud