summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* [sanitizer] Allow the sanitizer allocator to use a non-fixed address range. ↵Kostya Serebryany2016-04-221-1/+2
| | | | | | An allocator with a non-fixed address range will be attack-resistan. NFC for the sanitizers at this point. llvm-svn: 267094
* [asan] Add iOS support.Anna Zaks2016-02-021-1/+1
| | | | llvm-svn: 259451
* [sanitizers] generating html report on coverage dumpMike Aizatsky2016-01-271-0/+11
| | | | | | | | Subscribers: tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D16374 llvm-svn: 258999
* [sanitizers] using execv instead of execve with null env.Mike Aizatsky2016-01-271-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D16646 llvm-svn: 258983
* [sanitizers] extracted process management functionsMike Aizatsky2016-01-261-0/+63
| | | | | | Differential Revision: http://reviews.llvm.org/D16546 llvm-svn: 258849
* [asan] add option: handle_sigillKostya Serebryany2015-12-151-0/+1
| | | | llvm-svn: 255588
* tsan: fix Go build on linuxDmitry Vyukov2015-11-121-1/+1
| | | | | | librt is not linked in in Go build. llvm-svn: 252877
* Reapply r251918 ("[tsan] Fix build errors for TSan on OS X").Kuba Brecka2015-11-031-0/+43
| | | | llvm-svn: 251920
* Revert r251918 ("[tsan] Fix build errors for TSan on OS X").Kuba Brecka2015-11-031-42/+0
| | | | llvm-svn: 251919
* [tsan] Fix build errors for TSan on OS XKuba Brecka2015-11-031-0/+42
| | | | | | | | | | This patch moves a few functions from `sanitizer_linux_libcdep.cc` to `sanitizer_posix_libcdep.cc` in order to use them on OS X as well. Plus a few more small build fixes. This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point. Differential Revision: http://reviews.llvm.org/D14235 llvm-svn: 251918
* [sanitizer_common] Apply modernize-use-nullptr, other minor fixesVedant Kumar2015-09-301-5/+6
| | | | | | | | | | | | - Trim spaces. - Use nullptr in place of 0 for pointer variables. - Use '!p' in place of 'p == 0' for null pointer checks. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13310 llvm-svn: 248964
* [sanitizer] 2-nd attempt. Add the flag handle_sigfpe that is default true to ↵Kostya Serebryany2015-08-061-0/+1
| | | | | | handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski. This time the test is enabled only on x86-64 (it broke on ARM) llvm-svn: 244234
* Revert "[sanitizer] Add the flag handle_sigfpe that is default true to ↵Renato Golin2015-08-061-1/+0
| | | | | | | | handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski" This reverts commit r244136, it was breaking the ARM bots for too long. We should investigate it offline. llvm-svn: 244210
* [sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE ↵Kostya Serebryany2015-08-051-0/+1
| | | | | | crashes same as SIGSEV crashes, patch by Karl Skomski llvm-svn: 244136
* [sanitizer] Implement logging to syslog.Evgeniy Stepanov2015-07-231-3/+2
| | | | | | | | | | | | | | | | | Previously, Android target had a logic of duplicating all sanitizer output to logcat. This change extends it to all posix platforms via the use of syslog, controlled by log_to_syslog flag. Enabled by default on Android, off everywhere else. A bit of cmake magic is required to allow Printf() to call a libc function. I'm adding a stub implementation to support no-libc builds like dfsan and safestack. This is a second attempt. I believe I've fixed all the issues that prompted the revert: Mac build, and all kinds of non-CMake builds (there are 3 of those). llvm-svn: 243051
* Revert r242975.Evgeniy Stepanov2015-07-231-52/+2
| | | | | | Breaks Mac build. llvm-svn: 242978
* [sanitizer] Implement logging to syslog.Evgeniy Stepanov2015-07-221-2/+52
| | | | | | | | | | | | | Previously, Android target had a logic of duplicating all sanitizer output to logcat. This change extends it to all posix platforms via the use of syslog, controlled by log_to_syslog flag. Enabled by default on Android, off everywhere else. A bit of cmake magic is required to allow Printf() to call a libc function. I'm adding a stub implementation to support no-libc builds like dfsan and safestack. llvm-svn: 242975
* [asan] Fix undefined MAP_NORESERVE on FreeBSD.Evgeniy Stepanov2015-06-041-0/+7
| | | | llvm-svn: 238995
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-291-0/+51
| | | | | | | | | | | | | | | | | | This is done by creating a named shared memory region, unlinking it and setting up a private (i.e. copy-on-write) mapping of that instead of a regular anonymous mapping. I've experimented with regular (sparse) files, but they can not be scaled to the size of MSan shadow mapping, at least on Linux/X86_64 and ext3 fs. Controlled by a common flag, decorate_proc_maps, disabled by default. This patch has a few shortcomings: * not all mappings are annotated, especially in TSan. * our handling of memset() of shadow via mmap() puts small anonymous mappings inside larger named mappings, which looks ugly and can, in theory, hit the mapping number limit. llvm-svn: 238621
* [asan] under handle_abort=1 option intercept SIGABRT in addition to ↵Kostya Serebryany2015-05-051-0/+1
| | | | | | SIGSEGV/SIGBUS. Among other things this will allow to set up a death callback for SIGABRT and thus properly handle assert() in lib/Fuzzer llvm-svn: 236474
* [Sanitizer RT] Get rid of internal_isattyTimur Iskhodzhanov2015-04-081-2/+2
| | | | llvm-svn: 234423
* Move some POSIX-specific functions from sanitizer_libc.h to a new ↵Timur Iskhodzhanov2015-04-081-0/+1
| | | | | | sanitizer_posix.h llvm-svn: 234418
* [ASan] Make the remaining coverage tests pass on Darwin, move them to Posix/Alexander Potapenko2015-04-011-0/+15
| | | | | | | | | This CL: - moves PrepareForSandboxing() to sanitizer_posix_libcdep.cc - fixes the coverage tests to use flag substitutions defined in r233802 and not rely on hardcoded shared library names - moves those tests to TestCases/Posix so that they can be executed on Darwin llvm-svn: 233828
* [ASan] Add use_madv_dontdump flag.Yury Gribov2015-02-031-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D7294 llvm-svn: 227959
* [asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usageKostya Serebryany2015-01-211-0/+6
| | | | llvm-svn: 226636
* Fix -Wcast-qual warnings in sanitizersAlexey Samsonov2014-11-131-1/+1
| | | | llvm-svn: 221936
* PR20721: Don't let UBSan print inaccessible memoryAlexey Samsonov2014-09-171-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: UBSan needs to check if memory snippet it's going to print resides in addressable memory. Similar check might be helpful in ASan with dump_instruction_bytes option (see http://reviews.llvm.org/D5167). Instead of scanning /proc/self/maps manually, delegate this check to the OS kernel: try to write this memory in a syscall and assume that memory is inaccessible if the syscall failed (e.g. with EFAULT). Fixes PR20721. Test Plan: compiler-rt test suite Reviewers: eugenis, glider Reviewed By: glider Subscribers: emaste, ygribov, llvm-commits, glider, rsmith Differential Revision: http://reviews.llvm.org/D5253 llvm-svn: 217971
* Do not assume RLIM_INFINITY is always (rlim_t)-1in sanitizers codeViktor Kutuzov2014-09-061-3/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D5212 llvm-svn: 217308
* [ASan] allow deadly signals to be received in signal handlersAlexander Potapenko2014-09-041-1/+3
| | | | | | | (previously ASan would just crash upon the second SEGV) Other tools do not use this code yet. llvm-svn: 217137
* [TSan] Share the code the setup code calling getrlim/setrlim with ↵Alexey Samsonov2014-08-121-15/+34
| | | | | | sanitizer_common llvm-svn: 215481
* [ASan] Use a non-null altstack.ss_size when disabling sigaltstack on Darwin.Alexander Potapenko2014-04-251-1/+1
| | | | llvm-svn: 207220
* A set of trivial changes to support sanitizers on FreeBSD.Alexey Samsonov2014-03-041-4/+4
| | | | | | Patch by Viktor Kutuzov! llvm-svn: 202801
* Reapply r201910. MSVC gets __func__ defined explicitly, even though itJoerg Sonnenberger2014-02-261-1/+1
| | | | | | can't build anything here. llvm-svn: 202297
* Revert "Replace __FUNCTION__ with __func__, the latter being standard ↵Reid Kleckner2014-02-221-1/+1
| | | | | | | | | | | | C99/C++11." This reverts commit r201910. While __func__ may be standard in C++11, it was only recently added to MSVC in 2013 CTP, and LLVM supports MSVC 2012. __FUNCTION__ may not be standard, but it's *very* portable. llvm-svn: 201916
* Replace __FUNCTION__ with __func__, the latter being standard C99/C++11.Joerg Sonnenberger2014-02-211-1/+1
| | | | llvm-svn: 201910
* [asan] Override default sigaltstack setting on Android.Evgeniy Stepanov2014-02-181-1/+2
| | | | | | | Android libc always sets altstack on non-main threads, but it is too small for our unwinder. With use_sigaltstack=1, override this setting with a larger one. llvm-svn: 201557
* [libsanitizer] Fix compilation for gotsan.Alexander Potapenko2014-01-311-0/+2
| | | | llvm-svn: 200549
* [ASan] Move the SIGSEGV/SIGBUS handling to sanitizer_commonAlexander Potapenko2014-01-311-0/+25
| | | | | | | This change is a part of refactoring intended to have common signal handling behavior in all tools. This particular CL moves InstallSignalHandlers() into sanitizer_common (making it InstallDeadlySignalHandlers()), but doesn't enable default signal handlers for any tool other than ASan. llvm-svn: 200542
* [ASan] Move the sigaltstack() bits to sanitizer_common.Alexander Potapenko2014-01-281-0/+28
| | | | | | | This change is a part of refactoring intended to have common signal handling behavior in all tools. Note that this particular change doesn't enable use_sigaltstack support in every tool. llvm-svn: 200310
* [Sanitizer] Call Windows unwinder 'slow' and share StackTrace::Unwind across ↵Alexey Samsonov2013-11-071-16/+0
| | | | | | all platforms. No functionality change. llvm-svn: 194193
* [Sanitizer] Turn GetStackTrace() into StackTrace::Unwind()Alexey Samsonov2013-10-121-4/+4
| | | | llvm-svn: 192533
* [Sanitizer] Simplify StackTrace::FastUnwindStack interface and fix a bug ↵Alexey Samsonov2013-10-111-15/+9
| | | | | | with one-frame stack traces llvm-svn: 192428
* [sanitizer] Do not fall back to SlowUnwindStack() in GetStackTrace()Sergey Matveev2013-06-061-1/+1
| | | | llvm-svn: 183414
* [nolibc] Move libc-dependent sanitizer_posix.cc code to ↵Peter Collingbourne2013-05-211-0/+116
sanitizer_posix_libcdep.cc. llvm-svn: 182366
OpenPOWER on IntegriCloud