summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [hwasan] Fix malloc overflow detection.Evgeniy Stepanov2018-09-071-7/+9
| | | | | | | | | Check size limit before rounding up, otherwise malloc((size_t)-1) would happily allocate 0 bytes. Steal a nice test case from scudo. llvm-svn: 341612
* [hwasan] change the thread list so that main_thread can also be removedKostya Serebryany2018-09-072-8/+12
| | | | llvm-svn: 341610
* [hwasan] Remove allocator interceptors.Evgeniy Stepanov2018-09-063-93/+93
| | | | | | | | | | | | | | | | | | Summary: When building without COMPILER_RT_HWASAN_WITH_INTERCEPTORS, skip interceptors for malloc/free/etc and only export their versions with __sanitizer_ prefix. Also remove a hack in mallinfo() interceptor that does not apply to hwasan. Reviewers: kcc Subscribers: kubamracek, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D51711 llvm-svn: 341598
* [hwasan] fix pthread_exitKostya Serebryany2018-09-061-1/+1
| | | | llvm-svn: 341594
* [hwasan] introduce __hwasan_print_memory_usageKostya Serebryany2018-09-067-7/+59
| | | | llvm-svn: 341592
* [MSan] store origins for variadic function parameters in ↵Alexander Potapenko2018-09-061-0/+6
| | | | | | | | | | | | | | | | | __msan_va_arg_origin_tls Add the __msan_va_arg_origin_tls TLS array to keep the origins for variadic function parameters. Change the instrumentation pass to store parameter origins in this array. This is a reland of r341528. test/msan/vararg.cc doesn't work on Mips, PPC and AArch64 (because this patch doesn't touch them), XFAIL these arches. Also turned out Clang crashed on i80 vararg arguments because of incorrect origin type returned by getOriginPtrForVAArgument() - fixed it and added a test. llvm-svn: 341554
* [MSan] revert r341528 to unbreak the botsAlexander Potapenko2018-09-061-6/+0
| | | | llvm-svn: 341541
* ARM: wrap call to __clzsi2 so that the name is correct on MachO.Tim Northover2018-09-061-1/+1
| | | | | | | | MachO symbols are prefixed with an extra '_' (that's 3 in total for this function), so assembly calls have to go through a wrapper to insert any prefix needed. llvm-svn: 341540
* [MSan] store origins for variadic function parameters in ↵Alexander Potapenko2018-09-061-0/+6
| | | | | | | | | | __msan_va_arg_origin_tls Add the __msan_va_arg_origin_tls TLS array to keep the origins for variadic function parameters. Change the instrumentation pass to store parameter origins in this array. llvm-svn: 341528
* [hwasan] when verbose_threads==1, print the memory usage per threadKostya Serebryany2018-09-053-1/+11
| | | | llvm-svn: 341507
* [hwasan] simplify the code, NFCKostya Serebryany2018-09-054-21/+8
| | | | llvm-svn: 341501
* [hwasan] Don't handle signals on Android.Evgeniy Stepanov2018-09-051-0/+11
| | | | | | | | | | Sigtrap is used for error reporting, but all other signals are better left for the platform. In particular, sanitizer signal handlers do not dump registers or memory which makes debugging harder for no good reason. llvm-svn: 341500
* [Xray] Darwin providing defined value for weak symbols to fix linkage issueDavid Carlier2018-09-051-0/+9
| | | | | | - Temporary hack to make the buildbot failure stop on Darwin. llvm-svn: 341445
* Add glibc_prereq to platform limits mmsghdrBrian Cain2018-09-051-4/+5
| | | | | | | | | sendmmsg requires glibc >= 2.14. Fixes PR38589. Review: https://reviews.llvm.org/D51538 llvm-svn: 341442
* [hwasan] revert r341435 as it breaks the bot on aarch64Kostya Serebryany2018-09-051-11/+7
| | | | llvm-svn: 341441
* [hwasan] fix colored outputKostya Serebryany2018-09-051-0/+1
| | | | llvm-svn: 341440
* [hwasan] print thread IDs when reporting a bug (also had to fix ↵Kostya Serebryany2018-09-054-23/+36
| | | | | | pthread_create on Linux) llvm-svn: 341438
* [hwasan] use real TLS on linux to store the current thread -- this way we ↵Kostya Serebryany2018-09-051-7/+11
| | | | | | can call t->Destroy in __hwasan_thread_exit, same as on Android llvm-svn: 341435
* [hwasan] simplify the code, NFCKostya Serebryany2018-09-054-16/+8
| | | | llvm-svn: 341432
* [hwasan] remove stale Thread:: data members. While doing so noticed that ↵Kostya Serebryany2018-09-045-14/+14
| | | | | | GetThreadStackAndTls was always called with 'at_initialization=true', fixed that. llvm-svn: 341431
* [hwasan] add a unique id to a thread and add debug prints for thread ↵Kostya Serebryany2018-09-043-0/+16
| | | | | | creation/destruction llvm-svn: 341428
* [sanitizer] optimize internal_memset for the most performance critical case ↵Kostya Serebryany2018-09-041-0/+12
| | | | | | (16-byte-aligned) llvm-svn: 341420
* [libFuzzer] Enable tests on WindowsMatt Morehouse2018-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable tests on Windows and make check-fuzzer pass on it. Make check-fuzzer pass on Windows by fixing libFuzzer, fixing tests, and by disabling tests on Windows. Most of these are disabled temporarily as support for the tests and the features they test will be added incrementally. Other tests will not be enabled since they require things that are not on Windows (eg: afl_driver tests). Every test that was explicitly disabled on Windows has a comment explaining why (unless obvious like merge-posix.test). The lit.cfg file was modified to support running tests on windows. fuzzer-dirs.test was fixed by making the Windows implementation print the same error message as the posix version. merge-control-file.test was fixed by making the test binary end with the ".exe" extension (on all platforms). Patch By: metzman Reviewers: morehouse Reviewed By: morehouse Subscribers: srhines, mgorny Differential Revision: https://reviews.llvm.org/D51549 llvm-svn: 341385
* [TSan] Update assembly test again.Matt Morehouse2018-09-041-4/+4
| | | | | | Previous commit incorrectly updated the read1 case. llvm-svn: 341384
* [TSan] Update assembly code check.Matt Morehouse2018-09-041-2/+2
| | | | | | | The new assembly makes our benchmark faster, so it should be safe to update the check. llvm-svn: 341381
* 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-311-9/+10
| | | | | | | 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] 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-312-6/+51
| | | | 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-312-0/+7
| | | | | | stack addresses llvm-svn: 341156
* [hwasan] fix the linux-only pthread_create interceptor and reinstate the two ↵Kostya Serebryany2018-08-302-12/+14
| | | | | | threaded tests llvm-svn: 341143
* [hwasan] use thread-local ring buffers to properly report heap-use-after-freeKostya Serebryany2018-08-305-63/+51
| | | | llvm-svn: 341133
* [hwasan] simplify the thread hangling: instead of the ThreadRegistry (too ↵Kostya Serebryany2018-08-306-84/+53
| | | | | | 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-3010-18/+95
| | | | | | | | | | | | | | | | | | | | 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-304-4/+21
| | | | | | 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
OpenPOWER on IntegriCloud