summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_linux.h
AgeCommit message (Collapse)Author
2017-12-14[Sanitizers] Basic sanitizer Solaris support (PR 33274)Kamil Rytarowski
Summary: This is the first mostly working version of the Sanitizer port to 32-bit Solaris/x86. It is currently based on Solaris 11.4 Beta. This part was initially developed inside libsanitizer in the GCC tree and should apply to both. Subsequent parts will address changes to clang, the compiler-rt build system and testsuite. I'm not yet sure what the right patch granularity is: if it's profitable to split the patch up, I'd like to get guidance on how to do so. Most of the changes are probably straightforward with a few exceptions: * The Solaris syscall interface isn't stable, undocumented and can change within an OS release. The stable interface is the libc interface, which I'm using here, if possible using the internal _-prefixed names. * While the patch primarily target 32-bit x86, I've left a few sparc changes in. They cannot currently be used with clang due to a backend limitation, but have worked fine inside the gcc tree. * Some functions (e.g. largefile versions of functions like open64) only exist in 32-bit Solaris, so I've introduced a separate SANITIZER_SOLARIS32 to check for that. The patch (with the subsequent ones to be submitted shortly) was tested on i386-pc-solaris2.11. Only a few failures remain, some of them analyzed, some still TBD: AddressSanitizer-i386-sunos :: TestCases/Posix/concurrent_overflow.cc AddressSanitizer-i386-sunos :: TestCases/init-order-atexit.cc AddressSanitizer-i386-sunos :: TestCases/log-path_test.cc AddressSanitizer-i386-sunos :: TestCases/malloc-no-intercept.c AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/concurrent_overflow.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/start-deactivated.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/default_options.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/init-order-atexit.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/log-path_test.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/malloc-no-intercept.c SanitizerCommon-Unit :: ./Sanitizer-i386-Test/MemoryMappingLayout.DumpListOfModules SanitizerCommon-Unit :: ./Sanitizer-i386-Test/SanitizerCommon.PthreadDestructorIterations Maybe this is good enough the get the ball rolling. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, jyknight, kubamracek, krytarowski, fedor.sergeev, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40898 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320740 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[sanitizer] Introduce a vDSO aware timing functionKostya Kortchinsky
Summary: See D40657 & D40679 for previous versions of this patch & description. A couple of things were fixed here to have it not break some bots. Weak symbols can't be used with `SANITIZER_GO` so the previous version was breakin TsanGo. I set up some additional local tests and those pass now. I changed the workaround for the glibc vDSO issue: `__progname` is initialized after the vDSO and is actually public and of known type, unlike `__vdso_clock_gettime`. This works better, and with all compilers. The rest is the same. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D41121 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11[sanitizer] Revert rL320409Kostya Kortchinsky
Summary: D40679 broke a couple of builds, reverting while investigating. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D41088 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11[sanitizer] Introduce a vDSO aware time function, and use it in the ↵Kostya Kortchinsky
allocator [redo] Summary: Redo of D40657, which had the initial discussion. The initial code had to move into a libcdep file, and things had to be shuffled accordingly. `NanoTime` is a time sink when checking whether or not to release memory to the OS. While reducing the amount of calls to said function is in the works, another solution that was found to be beneficial was to use a timing function that can leverage the vDSO. We hit a couple of snags along the way, like the fact that the glibc crashes when clock_gettime is called from a preinit_array, or the fact that `__vdso_clock_gettime` is mangled (for security purposes) and can't be used directly, and also that clock_gettime can be intercepted. The proposed solution takes care of all this as far as I can tell, and significantly improve performances and some Scudo load tests with memory reclaiming enabled. @mcgrathr: please feel free to follow up on https://reviews.llvm.org/D40657#940857 here. I posted a reply at https://reviews.llvm.org/D40657#940974. Reviewers: alekseyshl, krytarowski, flowerhack, mcgrathr, kubamracek Reviewed By: alekseyshl, krytarowski Subscribers: #sanitizers, mcgrathr, srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D40679 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22Removed platform-specific ifdefs from sanitizer_procmaps.hFrancis Ricci
Summary: Removed platform-specific ifdefs for linux, mac, freebsd and netbsd from sanitizer_procmaps.h Patch by Yicheng Wang <yichengfb@fb.com> Reviewers: kcc, kubamracek, alekseyshl, fjricci, vitalybuka Reviewed By: fjricci, vitalybuka Subscribers: vitalybuka, emaste, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D38098 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-28Add NetBSD specific version of sanitizer_platform_limits_posixKamil Rytarowski
Summary: NetBSD is an Open-Source POSIX-like BSD Operating System. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, filcab, fjricci Reviewed By: kcc Subscribers: llvm-commits, kubamracek, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D37193 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08Reuse sanitizer_linux for NetBSDKamil Rytarowski
Summary: Follow FreeBSD and reuse sanitizer_linux for NetBSD. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, filcab, vitalybuka, fjricci, dvyukov Reviewed By: fjricci Subscribers: dvyukov, emaste, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36325 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310411 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13Fix sanitizer build against latest glibcKostya Serebryany
Summary: libsanitizer doesn't build against latest glibc anymore, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81066 for details. One of the changes is that stack_t changed from typedef struct sigaltstack { ... } stack_t; to typedef struct { ... } stack_t; for conformance reasons. And the other change is that the glibc internal __need_res_state macro is now ignored, so when doing ``` #define __need_res_state #include <resolv.h> ``` the effect is now the same as just ``` #include <resolv.h> ``` and thus one doesn't get just the ``` struct __res_state { ... }; ``` definition, but newly also the ``` extern struct __res_state *__res_state(void) __attribute__ ((__const__)); ``` prototype. So __res_state is no longer a type, but a function. Reviewers: kcc, ygribov Reviewed By: kcc Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D35246 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307969 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02[compiler-rt] move tsan's Android __get_tls() to sanitizer_commonKostya Kortchinsky
Summary: TSan's Android `__get_tls()` and `TLS_SLOT_TSAN` can be used by other sanitizers as well (see D32649), this change moves them to sanitizer_common. I picked sanitizer_linux.h as their new home. In the process, add the 32-bit versions for ARM, i386 & MIPS. Can the address of `__get_tls()[TLS_SLOT_TSAN]` change in between the calls? I am not sure if there is a need to repeat the construct as opposed to using a variable. So I left things as they were. Testing on my side was restricted to a successful cross-compilation. Reviewers: dvyukov, kubamracek Reviewed By: dvyukov Subscribers: aemerson, rengolin, srhines, dberris, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D32705 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301926 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Reapply "Enable LSan for arm Linux"Maxim Ostapenko
This patch reapplies r299923 with typo fixed in BLX macros. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Revert r299923, it doesn't build in bootstrap builds.Nico Weber
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.dir/sanitizer_linux.cc.o lib/sanitizer_common/sanitizer_linux.cc:1340:24: error: invalid instruction BLX(ip) ^ lib/sanitizer_common/sanitizer_linux.cc:1313:19: note: expanded from macro 'BLX' # define BLX(R) "mov lr, pc; bx" #R "\n" ^ <inline asm>:6:13: note: instantiated into assembly here mov lr, pc; bxip ^~~~ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299943 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11[lsan] Enable LSan for arm LinuxMaxim Ostapenko
This patch enables LSan for arm Linux. Differential Revision: https://reviews.llvm.org/D29586 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31[lsan] Renable LSan for x86 LinuxMaxim Ostapenko
The missed clang part was committed at https://reviews.llvm.org/rL293609 thus we can reenable LSan for x86 Linux. Differential Revision: https://reviews.llvm.org/D28609 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23Revert "[lsan] Enable LSan for x86 Linux."Evgeniy Stepanov
Breaks tests on i686/Linux due to missing clang driver support: error: unsupported option '-fsanitize=leak' for target 'i386-unknown-linux-gnu' git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23[lsan] Enable LSan for x86 Linux.Maxim Ostapenko
People keep asking LSan to be available on 32 bit targets (e.g. https://github.com/google/sanitizers/issues/403) despite the fact that false negative ratio might be huge (up to 85%). This happens for big real world applications that may contain random binary data (e.g. browser), but for smaller apps situation is not so terrible and LSan still might be useful. This patch adds initial support for x86 Linux (disabled by default), ARM32 is in TODO list. We used this patch (well, ported to GCC) on our 32 bit mobile emulators and it worked pretty fine thus I'm posting it here to initiate further discussion. Differential Revision: https://reviews.llvm.org/D28609 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06[ESan][MIPS] Adds support for MIPS64Sagar Thakur
With this patch 12 out of 13 tests are passing. Reviewed by zhaoqin. Differential: D23799 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@283435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08Revert "[ESan][MIPS] Adds support for MIPS64"Qin Zhao
Summary: This reverts commit 62b3eecdbe72af0255f0639b0446087a47efbf48. (D23799) The CL cause 13 ESan test failure on x86_64: Failing Tests (13): EfficiencySanitizer-x86_64 :: TestCases/large-stack-linux.c EfficiencySanitizer-x86_64 :: TestCases/libc-intercept.c EfficiencySanitizer-x86_64 :: TestCases/mmap-shadow-conflict.c EfficiencySanitizer-x86_64 :: TestCases/struct-simple.cpp EfficiencySanitizer-x86_64 :: TestCases/verbose-simple.c EfficiencySanitizer-x86_64 :: TestCases/workingset-early-fault.c EfficiencySanitizer-x86_64 :: TestCases/workingset-memset.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-midreport.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-samples.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-signal-posix.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-simple.cpp EfficiencySanitizer-x86_64 :: Unit/circular_buffer.cpp EfficiencySanitizer-x86_64 :: Unit/hashtable.cpp Unexpected Failures: 13 Reviewers: bruening, slthakur Subscribers: sdardis, kubabrecka, beanz Differential Revision: https://reviews.llvm.org/D24350 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07[ESan][MIPS] Adds support for MIPS64Sagar Thakur
With this patch 10 out of 13 tests are passing. Following is the list of failing tests: struct-simple.cpp workingset-signal-posix.cpp mmap-shadow-conflict.c Reviewed by bruening Differential: D23799 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14[sanitizer][esan] Add internal_sigaction_syscallDerek Bruening
Summary: Adds a version of sigaction that uses a raw system call, to avoid circular dependencies and support calling sigaction prior to setting up interceptors. The new sigaction relies on an assembly sigreturn routine for its restorer, which is Linux x86_64-only for now. Uses the new sigaction to initialize the working set tool's shadow fault handler prior to libc interceptor being set up. This is required to support instrumentation invoked during interceptor setup, which happens with an instrumented tcmalloc or other allocator compiled with esan. Adds a test that emulates an instrumented allocator. Reviewers: aizatsky Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21083 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14Revert r272591, http://lab.llvm.org:8011/builders/clang-x64-ninja-win7 has ↵Nico Weber
been broken since this landed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13[sanitizer][esan] Add internal_sigaction_syscallDerek Bruening
Summary: Adds a version of sigaction that uses a raw system call, to avoid circular dependencies and support calling sigaction prior to setting up interceptors. The new sigaction relies on an assembly sigreturn routine for its restorer, which is Linux x86_64-only for now. Uses the new sigaction to initialize the working set tool's shadow fault handler prior to libc interceptor being set up. This is required to support instrumentation invoked during interceptor setup, which happens with an instrumented tcmalloc or other allocator compiled with esan. Adds a test that emulates an instrumented allocator. Reviewers: aizatsky Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21083 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13Revert "[sanitizer][esan] Add internal_sigaction_syscall"Derek Bruening
This reverts commit r272553. The iOS build fails to link. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272557 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13[sanitizer][esan] Add internal_sigaction_syscallDerek Bruening
Summary: Adds a version of sigaction that uses a raw system call, to avoid circular dependencies and support calling sigaction prior to setting up interceptors. The new sigaction relies on an assembly sigreturn routine for its restorer, which is Linux x86_64-only for now. Uses the new sigaction to initialize the working set tool's shadow fault handler prior to libc interceptor being set up. This is required to support instrumentation invoked during interceptor setup, which happens with an instrumented tcmalloc or other allocator compiled with esan. Adds a test that emulates an instrumented allocator. Reviewers: aizatsky Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21083 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272553 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26[sanitizer] [SystemZ] Implement internal_clone.Marcin Koscielnicki
Differential Revision: http://reviews.llvm.org/D19159 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-15Revert "[sanitizer] [SystemZ] Abort if the kernel might be vulnerable to ↵Marcin Koscielnicki
CVE-2016-2143." This reverts commit r266297. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14[sanitizer] [SystemZ] Abort if the kernel might be vulnerable to CVE-2016-2143.Marcin Koscielnicki
In short, CVE-2016-2143 will crash the machine if a process uses both >4TB virtual addresses and fork(). ASan, TSan, and MSan will, by necessity, map a sizable chunk of virtual address space, which is much larger than 4TB. Even worse, sanitizers will always use fork() for llvm-symbolizer when a bug is detected. Disable all three by aborting on process initialization if the running kernel version is not known to contain a fix. Unfortunately, there's no reliable way to detect the fix without crashing the kernel. So, we rely on whitelisting - I've included a list of upstream kernel versions that will work. In case someone uses a distribution kernel or applied the fix themselves, an override switch is also included. Differential Revision: http://reviews.llvm.org/D18915 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25Revert "[sanitizers] extracted process management functions"Mike Aizatsky
This reverts commit e5b34d5a2bf4c882bc647dd26a8cea2adc76f63c. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25[sanitizers] extracted process management functionsMike Aizatsky
Differential Revision: http://reviews.llvm.org/D16542 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15[tsan] Use internal_sigfillset to replace REAL(sigfillset).Yabin Cui
Summary: Android doesn't intercept sigfillset, so REAL(sigfillset) is null. And we can use internal_sigfillset() for all cases. Reviewers: kcc, eugenis, kubabrecka, dvyukov Subscribers: llvm-commits, tberghammer, danalbert Differential Revision: http://reviews.llvm.org/D15296 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257862 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08[PPC64, TSAN] LLVM basic enablement of thread sanitizer for PPC64 (BE and LE)Bill Schmidt
This patch is by Simone Atzeni with portions by Adhemerval Zanella. This contains the LLVM patches to enable the thread sanitizer for PPC64, both big- and little-endian. Two different virtual memory sizes are supported: Old kernels use a 44-bit address space, while newer kernels require a 46-bit address space. There are two companion patches that will be added shortly. There is a Clang patch to actually turn on the use of the thread sanitizer for PPC64. There is also a patch that I wrote to provide interceptor support for setjmp/longjmp on PPC64. Patch discussion at reviews.llvm.org/D12841. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255057 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-05[tsan] Enable tsan for aarch64Adhemerval Zanella
This patch enabled TSAN for aarch64 with 39-bit VMA layout. As defined by tsan_platform.h the layout used is: 0000 4000 00 - 0200 0000 00: main binary 2000 0000 00 - 4000 0000 00: shadow memory 4000 0000 00 - 5000 0000 00: metainfo 5000 0000 00 - 6000 0000 00: - 6000 0000 00 - 6200 0000 00: traces 6200 0000 00 - 7d00 0000 00: - 7d00 0000 00 - 7e00 0000 00: heap 7e00 0000 00 - 7fff ffff ff: modules and main thread stack Which gives it about 8GB for main binary, 4GB for heap and 8GB for modules and main thread stack. Most of tests are passing, with the exception of: * ignore_lib0, ignore_lib1, ignore_lib3 due a kernel limitation for no support to make mmap page non-executable. * longjmp tests due missing specialized assembly routines. These tests are xfail for now. The only tsan issue still showing is: rtl/TsanRtlTest/Posix.ThreadLocalAccesses Which still required further investigation. The test is disable for aarch64 for now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244055 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04[ASan] Make binary name reader cross-platform.Yury Gribov
Differential Revision: http://reviews.llvm.org/D10213 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239020 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-08Move some POSIX-specific functions from sanitizer_libc.h to a new ↵Timur Iskhodzhanov
sanitizer_posix.h git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234418 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27[compiler-rt] Allow suppression file to be relative to the location of the ↵Anna Zaks
executable The ASanified executable could be launched from different locations. When we cannot find the suppression file relative to the current directory, try to see if the specified path is relative to the location of the executable. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230723 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19[LSan] [MIPS] adding support of LSan for mips64/mips64el archMohit K. Bhakkad
Patch by Sagar Thakur Reviewers: petarj, earthdok, kcc. Subscribers: samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits. Differential Revision: http://reviews.llvm.org/D7013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229830 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-13Removed r221896, it seems to break build in various ways.Yury Gribov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221912 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-13[ASan] Add process basename to log name and error message to simplify ↵Yury Gribov
analysis of sanitized systems logs. Reviewed at http://reviews.llvm.org/D5724 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221896 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07[FreeBSD] Port sanitizers' syscalls.Alexey Samsonov
Patch by Viktor Kutuzov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203227 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04A set of trivial changes to support sanitizers on FreeBSD.Alexey Samsonov
Patch by Viktor Kutuzov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202801 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-24AdjustStackSizeLinux() is used in Lsan, Tsan and Msan non-Linux-specific ↵Kostya Serebryany
code so it seems it should have more generic name and moved to a common scope. Renamed to AdjustStackSize. Patch by Viktor Kutuzov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202011 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31Make signal-related functions use __sanitizer_* structures instead of ↵Alexander Potapenko
__sanitizer_kernel_* ones. Also rename internal_sigaction() into internal_sigaction_norestorer(), as this function doesn't fully implement the sigaction() functionality on Linux. This change is a part of refactoring intended to have common signal handling behavior in all tools. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200535 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15tsan: use verbosity flag in sanitizer_common code directlyDmitry Vyukov
now it's available from common_flags() git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192705 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15tsan: move kernel struct definition from sanitizer_linux.h to ↵Dmitry Vyukov
sanitizer_platform_limits_posix.h git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192695 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15tsan: implement internal syscall-based versions of sigaction/sigprocmaskDmitry Vyukov
use them in stoptheworld fixes applications that intercept sigaction/sigprocmask git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192686 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-11[sanitizer] Define kPthreadDestructorIterations on POSIX systems.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192453 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-11[sanitizer] Move the PTHREAD_DESTRUCTOR_ITERATIONS constant to ↵Sergey Matveev
sanitizer_linux.h. Add a test. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192442 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10[Sanitizer] Refactor symbolization interface: use class instead of several ↵Alexey Samsonov
functions. Move some code around to get rid of extra source files git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190410 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02[sanitizer_common] Add internal_clone().Sergey Matveev
Add a wrapper for the clone syscall for use in StopTheWorld. We implement it only for x86_64, so stop building StopTheWorld for other platforms (no one uses it outside x86_64 anyway). See https://code.google.com/p/address-sanitizer/issues/detail?id=214 for why we can't use the glibc clone() wrapper. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189753 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29Move UnpoisonMappedDSO to sanitizer_common.Peter Collingbourne
This is so DFSan will be able to use it. Differential Revision: http://llvm-reviews.chandlerc.com/D1206 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187372 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-11[Sanitizer] support running external llvm-symbolizer on MacAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183730 91177308-0d34-0410-b5e6-96231b3b80d8