Commit Graph

66 Commits

Author SHA1 Message Date
Kostya Serebryany 06222915cf [lsan] remove LeakSanitizerIsTurnedOffForTheCurrentProcess (this was a bad idea), leave __lsan_is_turned_off
llvm-svn: 199304
2014-01-15 08:04:21 +00:00
Evgeniy Stepanov fc0ba53531 [msan] Fix an incorrect comment.
llvm-svn: 199300
2014-01-15 06:49:40 +00:00
Sergey Matveev 3a47244c94 [lsan] Add __lsan_default_suppressions() to the public interface header.
llvm-svn: 199121
2014-01-13 17:26:57 +00:00
Kostya Serebryany e8699fcd8e [sanitizer] fix comment
llvm-svn: 199112
2014-01-13 15:06:20 +00:00
Kostya Serebryany 27f5b8800d [lsan] rename __lsan_is_turned_off to LeakSanitizerIsTurnedOffForTheCurrentProcess (leave the old variant for now for compatibility)
llvm-svn: 198921
2014-01-10 07:58:25 +00:00
Alexey Samsonov cef2e14382 [ASan] Get rid of __asan_symbolize function
llvm-svn: 197670
2013-12-19 11:08:47 +00:00
Sergey Matveev 7237879926 [lsan] Introduce __lsan_(un)register_root_region().
Add an interface for telling LSan that a region of memory is to be treated as a
source of live pointers. Useful for code which stores pointers in mapped memory.

llvm-svn: 197489
2013-12-17 11:11:23 +00:00
Alexey Samsonov 4fc8098979 [TSan] Move declarations of __tsan_atomic functions to a public header
llvm-svn: 197015
2013-12-11 08:18:50 +00:00
Sergey Matveev d8fb4d8f91 [sanitizer] Expose __sanitizer_print_stack_trace().
Expose a new interface function for debugging code built with sanitizer tools.
Add an ASan implementation.

llvm-svn: 196302
2013-12-03 18:24:28 +00:00
Kostya Serebryany 3771a3dd73 [asan] remove a fixed FIXME; extend the comment around __sanitizer_annotate_contiguous_container
llvm-svn: 195131
2013-11-19 14:54:14 +00:00
Kostya Serebryany 7b664299f0 [asan] new shadow poison magic for contiguous-container-buffer-overflow, addressed Alexey Samsonov's comments for r195011
llvm-svn: 195117
2013-11-19 08:40:07 +00:00
Kostya Serebryany 3d97c2040d [asan] introduce __sanitizer_annotate_contiguous_container
llvm-svn: 195011
2013-11-18 14:02:05 +00:00
Alexey Samsonov 1011fe6a6e CMake: make sure compiler-rt headers are copied to build tree if 'compilrer-rt' target is built
llvm-svn: 195002
2013-11-18 10:57:36 +00:00
Bob Wilson a08e9ac927 Reapply asan coverage changes 194702-194704.
I still don't know what is causing our bootstrapped LTO buildbots to fail,
but llvm r194701 seems to be OK and I can't imagine that these changes could
cause the problem.

llvm-svn: 194790
2013-11-15 07:18:15 +00:00
Bob Wilson abc91eacac Speculatively revert asan coverage changes 194702-194704.
Apple's bootstrapped LTO builds have been failing, and these changes (along
with llvm 194701) are the only things on the blamelist.  I will either reapply
these changes or help debug the problem, depending on whether this fixes the
buildbots.

llvm-svn: 194779
2013-11-15 03:26:28 +00:00
Kostya Serebryany c46f281f83 [asan] unbreak dfsan, which includes sanitizer/common_interface_defs.h into internal sources (although it shoudn't)
llvm-svn: 194704
2013-11-14 13:44:43 +00:00
Kostya Serebryany 91c52d9552 [asan] Poor man's coverage that works with ASan (compiler-rt part)
llvm-svn: 194702
2013-11-14 13:28:17 +00:00
Dmitry Vyukov 2346c7a511 tsan: fix linux syscall hooks
the file references non-existent arguments and breaks build

llvm-svn: 193234
2013-10-23 08:40:19 +00:00
Dmitry Vyukov 67a1eef05b tsan: remove __sanitizer_set_report_fd function from public interface
__sanitizer_set_report_path now accepts two special values - stderr and stdout
logging to other file descriptors is not supported anymore,
it's fragile in presence of multiple processes, fork, etc

llvm-svn: 192706
2013-10-15 14:14:34 +00:00
Dmitry Vyukov 1da6b4d5c8 tsan: intercept fork syscall
llvm-svn: 191144
2013-09-21 20:59:04 +00:00
Evgeniy Stepanov 2b31d7186e [msan] Make all pointers in msan_interface "const volatile void *".
This way msan annotations can be used with both normal and volatile memory.

llvm-svn: 190403
2013-09-10 11:54:51 +00:00
Evgeniy Stepanov df96e863de [msan] bool -> int to make msan_interface.h C-compatible.
llvm-svn: 190402
2013-09-10 11:04:37 +00:00
Evgeniy Stepanov 5c1035e7fa [sanitizer] A bunch of linux system call handlers.
llvm-svn: 190157
2013-09-06 14:20:01 +00:00
Peter Collingbourne 7da504faa4 [dfsan] Introduce dfsan_read_label runtime function.
Differential Revision: http://llvm-reviews.chandlerc.com/D1349

llvm-svn: 188319
2013-08-13 22:15:40 +00:00
Dmitry Vyukov 4ba287f328 dfsan: fix lint warning
llvm-svn: 188292
2013-08-13 16:52:07 +00:00
Peter Collingbourne 21b2929aca [dfsan] Introduce dfsan_union runtime function.
Differential Revision: http://llvm-reviews.chandlerc.com/D1347

llvm-svn: 188229
2013-08-12 23:47:37 +00:00
Peter Collingbourne 5cbab07d02 DataFlowSanitizer; compiler-rt changes.
DataFlowSanitizer is a generalised dynamic data flow analysis.

Unlike other Sanitizer tools, this tool is not designed to detect a
specific class of bugs on its own.  Instead, it provides a generic
dynamic data flow analysis framework to be used by clients to help
detect application-specific issues within their own code.

Differential Revision: http://llvm-reviews.chandlerc.com/D967

llvm-svn: 187924
2013-08-07 22:47:26 +00:00
Alexey Samsonov b42ea7ef21 Lint fixes
llvm-svn: 187726
2013-08-05 13:20:39 +00:00
Evgeniy Stepanov 44b77c26e4 [msan] Allocator statistics interface and malloc hooks.
llvm-svn: 187653
2013-08-02 14:26:58 +00:00
Evgeniy Stepanov 3feb17c452 [sanitizer] Tweak read syscall handler signature for consistency.
llvm-svn: 187417
2013-07-30 13:16:52 +00:00
Evgeniy Stepanov 9fbd981f99 [sanitizer] read() syscall hook.
llvm-svn: 187414
2013-07-30 13:04:43 +00:00
Sergey Matveev 655bd0d08c [lsan] Add __lsan_do_leak_check() to the public interface.
Let users override the normal behavior to run leak checking earlier in
the process. Also fix a couple nits here and there.

llvm-svn: 186581
2013-07-18 14:06:07 +00:00
Evgeniy Stepanov f7f252d025 [sanitizer] Syscall handlers for clock_gettime and clock_getres.
llvm-svn: 185913
2013-07-09 08:54:59 +00:00
Alexey Samsonov 895784a5b0 [LSan] Add the way to disable LSan at link time
llvm-svn: 185066
2013-06-27 09:35:50 +00:00
Evgeniy Stepanov ae4e1ec4e6 [msan] Add keep_going runtime flag.
llvm-svn: 184542
2013-06-21 12:37:58 +00:00
Alexey Samsonov 7e325fb477 Properly install LSan interface header, rely on sanitizer header presence in lit tests
llvm-svn: 183977
2013-06-14 11:45:36 +00:00
Sergey Matveev ecc4f5ba8e [lsan] Implement __lsan_ignore_object().
Leak annotation similar to HeapChecker's IgnoreObject().

llvm-svn: 183412
2013-06-06 14:17:56 +00:00
Sergey Matveev 17ee1abfa7 [lsan] Add __lsan_disable() and __lsan_enable().
Objects allocated after a call to __lsan_disable() will be treated as
live memory. Also add a ScopedDisabler.

llvm-svn: 183099
2013-06-03 11:21:34 +00:00
Alexey Samsonov 34093f0de8 [MSan] Make a few interface functions accept 'const void *' instead of 'void*'
llvm-svn: 180102
2013-04-23 13:34:19 +00:00
Evgeniy Stepanov 1a2262e1c9 [sanitizer] Fix lint.
llvm-svn: 180012
2013-04-22 13:28:26 +00:00
Evgeniy Stepanov 9b59a39f42 [sanitizer] Implement wait4 and waitpid syscall hooks.
llvm-svn: 179592
2013-04-16 13:06:20 +00:00
Evgeniy Stepanov 9fb82357dc [sanitizer] More syscall handler placeholders.
This time it's the full list scavenged from syscalls.h
Fixed return value type.

llvm-svn: 179378
2013-04-12 14:06:40 +00:00
Alexey Samsonov 9f3938e271 Explicitly list all sanitizer headers in CMake build rules. Make sure sanitizer lit_tests depend on fresh headers.
llvm-svn: 179293
2013-04-11 15:49:52 +00:00
Evgeniy Stepanov f5523116e9 [sanitizer] Syscall hooks.
Pre- and post- hooks for linux syscalls. Not wired into anything, but exposed
through public interface.

llvm-svn: 179288
2013-04-11 14:37:04 +00:00
Kostya Serebryany 92684efb1d [asan] implement callbacks for unaligned loads/stores
Reviewers: samsonov

Reviewed By: samsonov

CC: samsonov, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D652

llvm-svn: 179175
2013-04-10 13:59:32 +00:00
Kostya Serebryany fd61b6f0c8 [asan] make asan work with 7fff8000 offset and prelink
When prelink is installed in the system, prelink-ed
libraries map between 0x003000000000 and 0x004000000000 thus occupying the shadow Gap,
so we need so split the address space even further, like this:
|| [0x10007fff8000, 0x7fffffffffff] || HighMem    ||
|| [0x02008fff7000, 0x10007fff7fff] || HighShadow ||
|| [0x004000000000, 0x02008fff6fff] || ShadowGap3 ||
|| [0x003000000000, 0x003fffffffff] || MidMem     ||
|| [0x00087fff8000, 0x002fffffffff] || ShadowGap2 ||
|| [0x00067fff8000, 0x00087fff7fff] || MidShadow  ||
|| [0x00008fff7000, 0x00067fff7fff] || ShadowGap  ||
|| [0x00007fff8000, 0x00008fff6fff] || LowShadow  ||
|| [0x000000000000, 0x00007fff7fff] || LowMem     ||

Do it only if necessary.

Also added a bit of profiling code to make sure that the
mapping code is efficient.

Added a lit test to simulate prelink-ed libraries.
Unfortunately, this test does not work with binutils-gold linker.
If gold is the default linker the test silently passes.

Also replaced
__has_feature(address_sanitizer)
with
__has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
in two places.

Patch partially by Jakub Jelinek.

llvm-svn: 175263
2013-02-15 12:00:24 +00:00
Kostya Serebryany b4c2c5c8a6 [asan] print a short one-line report summary after the full report. Currently, works only if symbolization happens in-process.
llvm-svn: 174501
2013-02-06 12:36:49 +00:00
Alexey Samsonov a0c0da8f51 [ASan] Split ASan interface header into private and public parts. Add a test that makes sure users can include interface header
llvm-svn: 174058
2013-01-31 13:46:14 +00:00
Evgeniy Stepanov 358698279d [sanitizer] Further split private and public sanitizer headers.
And make msan_interface.h C-compatible.

llvm-svn: 173928
2013-01-30 13:12:08 +00:00
Evgeniy Stepanov 5725e5b715 [msan] Remove an extra #ifdef.
__has_feature is always defined at this point.

llvm-svn: 173920
2013-01-30 09:56:11 +00:00