summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix buildbot testDavid Carlier2018-09-021-1/+1
| | | | llvm-svn: 341286
* [Sanitizer] openbsd build fixDavid Carlier2018-09-021-0/+6
| | | | | | | | | | | | sysctl has a different signature under OpenBSD Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D51572 llvm-svn: 341285
* [hwasan] Fix new[] with zero size.Evgeniy Stepanov2018-08-313-10/+32
| | | | | | | Fixes "allocator is out of memory trying to allocate 0x0 bytes" by always allocating at least one byte. llvm-svn: 341229
* Try to unbreak internal_sysctl() for MacOSXKamil Rytarowski2018-08-311-1/+2
| | | | | | Cast the 5th argument to (void *), removing cast. llvm-svn: 341192
* Try to fix internal_sysctl() for MacOSXKamil Rytarowski2018-08-311-1/+1
| | | | | | Cast the first argument to (int *) removing const. llvm-svn: 341187
* Improve portability of internal_sysctl()Kamil Rytarowski2018-08-312-2/+2
| | | | | | Add an explicit cast from uptr to size_t to prevent potential type mismatch. llvm-svn: 341183
* Add internal_sysctl() used by FreeBSD, NetBSD, OpenBSD and MacOSXKamil Rytarowski2018-08-315-18/+34
| | | | | | | | | | | | | | | | | | | | | | | Summary: Switch local sysctl(2) calls to internal_sysctl(). This is a preparation for introduction of interceptors for the sysctl*() family of functions and switching `internal_sysctl*()` to libc calls bypassing interceptors. No functional change intended with this revision. Reviewers: vitalybuka, joerg, kcc Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D51425 llvm-svn: 341181
* [hwasan] move code around to remove an opaque class definition ↵Kostya Serebryany2018-08-312-51/+47
| | | | | | (HwasanThreadLocalMallocStorage) that had incorrect size and used 10x more than needed RAM (500K instead of 50K per thread) llvm-svn: 341170
* [hwasan] simplify the code, NFCKostya Serebryany2018-08-312-17/+6
| | | | llvm-svn: 341166
* [hwasan] more heap-buffer-overflow testsKostya Serebryany2018-08-311-5/+10
| | | | llvm-svn: 341162
* [hwasan] report heap-buffer-overflow location, once, not once per each live ↵Kostya Serebryany2018-08-311-41/+41
| | | | | | thread llvm-svn: 341160
* [hwasan] properly report heap-buffer-overflowKostya Serebryany2018-08-313-6/+67
| | | | llvm-svn: 341159
* [hwasan] fix the build on Linux Ubuntu 14.04. We don't need __hwasan_shadow ↵Kostya Serebryany2018-08-311-0/+11
| | | | | | on Linux at all llvm-svn: 341158
* [hwasan] make malloc(0) return nullptr, add basic address description for ↵Kostya Serebryany2018-08-316-2/+24
| | | | | | stack addresses llvm-svn: 341156
* [hwasan] fix the linux-only pthread_create interceptor and reinstate the two ↵Kostya Serebryany2018-08-304-12/+77
| | | | | | threaded tests llvm-svn: 341143
* [hwasan] use thread-local ring buffers to properly report heap-use-after-freeKostya Serebryany2018-08-308-66/+54
| | | | llvm-svn: 341133
* [hwasan] temporarily remove two tests to silence the botsKostya Serebryany2018-08-302-63/+0
| | | | llvm-svn: 341129
* [hwasan] simplify the thread hangling: instead of the ThreadRegistry (too ↵Kostya Serebryany2018-08-307-84/+90
| | | | | | heavy) simply maintain a linked list of Threads llvm-svn: 341111
* [Xray] Darwin fix variable typoDavid Carlier2018-08-301-1/+1
| | | | llvm-svn: 341090
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-3012-20/+103
| | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Patch By: metzman Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 341082
* [Xray] Darwin improving slightly the supportDavid Carlier2018-08-303-3/+7
| | | | | | | | | | | | | using sysctl to get the tic frequency data. still linkage issue for X-ray_init not resolved. Reviewers: dberris, kubamracek Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D51399 llvm-svn: 341019
* [sanitizer] Transition to new _zx_vmar_... callsPetr Hosek2018-08-302-18/+16
| | | | | | | | | Now that all _zx_vmar_... calls have been updated, we can undo the change made in r337801 and switch over to the new calls. Differential Revision: https://reviews.llvm.org/D51468 llvm-svn: 341011
* [hwasan] add a simple threaded UAF test, make it work on x86 (need to ↵Kostya Serebryany2018-08-305-4/+47
| | | | | | disable tagging in malloc with inside pthread_create) llvm-svn: 341007
* [hwasan] add basic ThreadRegistry plumbing, also rename HwasanThread to ThreadKostya Serebryany2018-08-307-40/+107
| | | | llvm-svn: 341005
* [hwasan] remove even more stale codeKostya Serebryany2018-08-292-33/+6
| | | | llvm-svn: 340989
* [hwasan] remove more stale codeKostya Serebryany2018-08-293-57/+27
| | | | llvm-svn: 340985
* [hwasan] get rid of some macros, remove the fixed shadow mappingKostya Serebryany2018-08-298-60/+40
| | | | llvm-svn: 340983
* [hwasan] formatting change, NFCKostya Serebryany2018-08-299-10/+13
| | | | llvm-svn: 340980
* [hwasan] rename some variables and functions for better readability, NFCKostya Serebryany2018-08-294-51/+54
| | | | llvm-svn: 340979
* [libFuzzer] Remove mutation stats and weighted mutation selection.Max Moroz2018-08-297-109/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This was an experimental feature. After evaluating it with: 1) https://github.com/google/fuzzer-test-suite/tree/master/engine-comparison 2) enabling on real world fuzz targets running at ClusterFuzz and OSS-Fuzz The following conclusions were made: 1) With fuzz targets that have reached a code coverage plateau, the feature does not improve libFuzzer's ability to discover new coverage and may actually negatively impact it. 2) With fuzz targets that have not yet reached a code coverage plateau, the feature might speed up new units discovery in some cases, but it is quite rare and hard to confirm with a high level on confidence. Revert of https://reviews.llvm.org/D48054 and https://reviews.llvm.org/D49621. Reviewers: metzman, morehouse Reviewed By: metzman, morehouse Subscribers: delcypher, #sanitizers, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D51455 llvm-svn: 340976
* [hwasan] simplify the realloc implementation: always allocate/deallocate on ↵Kostya Serebryany2018-08-293-28/+42
| | | | | | realloc. This may slowdown some realloc-heavy code, but at least at this point a want simpler code. Also added a test llvm-svn: 340973
* Add a thread-local ring buffer of heap allocationsKostya Serebryany2018-08-296-4/+60
| | | | | | | | | | | | | | | | | | Summary: We need this in order to properly report heap-use-after-free, since we don't have a quarantine. This is a first part of the code, more like a proof of concept. But I'd like to commit at as is and proceed with refactoring, adding a ThreadRegistry, and extending the functionality. Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51394 llvm-svn: 340971
* [sanitizer] reapply r340884 'Add a RingBuffer class to sanitizer_common', ↵Kostya Serebryany2018-08-294-0/+159
| | | | | | with fixes for Windows llvm-svn: 340969
* [sanitizer] Revert D50940Kostya Kortchinsky2018-08-297-14/+11
| | | | | | | | | | | | | | | | | Summary: The previous version of the patch makes some code unable to distinguish failure to map address 0 and error. Revert to turn the bots back to green while figuring out a new approach. Reviewers: eugenis Reviewed By: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51451 llvm-svn: 340957
* Revert "[libFuzzer] Port to Windows"Matt Morehouse2018-08-2912-100/+20
| | | | | | This reverts r340949 due to bot breakage again. llvm-svn: 340954
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-2912-20/+100
| | | | | | | | | | | | | | | | | | Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 340949
* Revert r340884 "Add a RingBuffer class to sanitizer_common"Hans Wennborg2018-08-294-166/+0
| | | | | | | | | | | | | | | | | | | The test doesn't pass on Windows, where sizeof(long) == 4 also on 64-bit, and so it isn't a multiple of sizeof(void*). This also reverts the follow-up r340886. > Summary: a constrained RingBuffer optimized for fast push > > Reviewers: eugenis > > Reviewed By: eugenis > > Subscribers: kubamracek, mgorny, delcypher, #sanitizers, llvm-commits > > Differential Revision: https://reviews.llvm.org/D51196 llvm-svn: 340924
* Introduce new type for inteceptors UINTMAX_TKamil Rytarowski2018-08-292-2/+3
| | | | | | | | | | | | | | | | | | | | | Summary: The UINTMAX_T type will be used in new interceptors. While there, correct the type of strtoumax(3) from INTMAX_T to UINTMAX_T. Original patch from Yang Zheng. Reviewers: vitalybuka, kcc, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, tomsun.0.7, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D51106 llvm-svn: 340907
* [sanitizer] fix a testKostya Serebryany2018-08-281-19/+20
| | | | llvm-svn: 340886
* Add a RingBuffer class to sanitizer_commonKostya Serebryany2018-08-284-0/+165
| | | | | | | | | | | | | | Summary: a constrained RingBuffer optimized for fast push Reviewers: eugenis Reviewed By: eugenis Subscribers: kubamracek, mgorny, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51196 llvm-svn: 340884
* Revert "[libFuzzer] Port to Windows"Matt Morehouse2018-08-2812-100/+20
| | | | | | This reverts commit r340860 due to failing tests. llvm-svn: 340867
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-2812-20/+100
| | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Patch By: metzman Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 340860
* SafeStack: Fix thread liveness check on *BSDVlad Tsyrklevich2018-08-281-1/+4
| | | | | | | | | | | | | | | | Summary: The Linux/BSD system call interfaces report errors differently, use the internal_iserror() function to correctly check errors on either. Reviewers: eugenis Reviewed By: eugenis Subscribers: delcypher, llvm-commits, #sanitizers, krytarowski, kcc, devnexen Differential Revision: https://reviews.llvm.org/D51368 llvm-svn: 340856
* [XRay][compiler-rt] Remove uses of internal allocator in profiling modeDean Michael Berris2018-08-281-24/+30
| | | | | | | | | | | | | | | | | | Summary: This change removes further cases where the profiling mode implementation relied on dynamic memory allocation. We're using thread-local aligned (uninitialized) memory instead, which we initialize appropriately with placement new. Addresses llvm.org/PR38577. Reviewers: eizan, kpw Subscribers: jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D51278 llvm-svn: 340814
* [XRay][compiler-rt] Stash flags as well in x86_64 trampolineDean Michael Berris2018-08-281-0/+2
| | | | | | | | | | | | | | | | Summary: This change saves and restores the full flags register in x86_64 mode. This makes running instrumented signal handlers safer, and avoids flags set during the execution of the event handlers from polluting the instrumented call's flags state. Reviewers: kpw, eizan, jfb Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51277 llvm-svn: 340812
* [lsan] Check that leak sanitizer works in the forked processVitaly Buka2018-08-271-0/+23
| | | | | | Regression test for PR38698 llvm-svn: 340769
* [sanitizer][fuzzer] Transition back to ZX_TIME_INFINITEPetr Hosek2018-08-272-11/+5
| | | | | | | | | | Now that all Zircon calls have been transitioned to take time as signed value, we can transition back to ZX_TIME_INFINITE, undoing the change made in r337802. Differential Revision: https://reviews.llvm.org/D51266 llvm-svn: 340764
* Revert "[lsan] Do not check for leaks in the forked process"Vitaly Buka2018-08-272-44/+0
| | | | | | | | Users need leak reports in forks. This reverts commit r334036. llvm-svn: 340758
* [scudo] Replace eraseHeader with compareExchangeHeader for Quarantined chunksKostya Kortchinsky2018-08-241-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The reason for the existence of `eraseHeader` was that it was deemed faster to null-out a chunk header, effectively making it invalid, rather than marking it as available, which incurred a checksum computation and a cmpxchg. A previous use of `eraseHeader` was removed with D50655 due to a race. Now we remove the second use of it in the Quarantine deallocation path and replace is with a `compareExchangeHeader`. The reason for this is that greatly helps debugging some heap bugs as the chunk header is now valid and the chunk marked available, as opposed to the header being invalid. Eg: we get an invalid state error, instead of an invalid header error, which reduces the possibilities. The computational penalty is negligible. Reviewers: alekseyshl, flowerhack, eugenis Reviewed By: eugenis Subscribers: delcypher, jfb, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51224 llvm-svn: 340633
* [Sanitizer] implementing remaining function under OSXDavid Carlier2018-08-242-5/+8
| | | | | | | | | | | | | - GetRandom and GetnumberOfCPUs using sys call for the former. - enabling unit tests for the other oses. Reviewers: kubamracek Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D50937 llvm-svn: 340621
OpenPOWER on IntegriCloud