Sergey Matveev
c5c84a1d86
[sanitizer] Implement ioctl decoding.
...
When an unknown ioctl is encountered, try to guess the parameter size from the
request id.
llvm-svn: 200872
2014-02-05 19:35:24 +00:00
Kostya Serebryany
9ebd483017
[sanitizer] hide two functions in the __sanitizer namespace to avoid exporting them (gold complained)
...
llvm-svn: 200844
2014-02-05 15:06:32 +00:00
Dmitry Vyukov
93474a9acd
tsan: fix windows alignment check
...
llvm-svn: 200838
2014-02-05 13:41:09 +00:00
Dmitry Vyukov
a54308fc6d
tsan: deflake flaky test
...
llvm-svn: 200833
2014-02-05 12:01:34 +00:00
Dmitry Vyukov
7799eb123b
tsan: ensure proper alignment of mmaps on windows
...
llvm-svn: 200832
2014-02-05 11:37:20 +00:00
Timur Iskhodzhanov
4a25d42a3c
[ASan/Win] Add DLL thunks for __asan_{,un}poison_memory_region
...
llvm-svn: 200809
2014-02-04 23:54:26 +00:00
Timur Iskhodzhanov
aeefb6abce
[ASan/Win] Fall back to stdout if we can't print the reports to stderr
...
llvm-svn: 200804
2014-02-04 23:28:30 +00:00
Dmitry Vyukov
d7fcee8d8c
tsan: add windows native build script
...
llvm-svn: 200780
2014-02-04 17:52:41 +00:00
Dmitry Vyukov
a61c2b0bd5
tsan: fix windows build
...
llvm-svn: 200779
2014-02-04 17:29:44 +00:00
Dmitry Vyukov
a538aac8ce
tsan: fix windows build
...
llvm-svn: 200778
2014-02-04 17:27:29 +00:00
Dmitry Vyukov
2da2cee706
tsan: update Go public interface
...
in preparation for https://codereview.appspot.com/55100044
llvm-svn: 200766
2014-02-04 14:45:54 +00:00
Alexey Samsonov
fafbcb6d4c
[CMake] Fixup for r200753
...
llvm-svn: 200761
2014-02-04 13:24:13 +00:00
Alexander Potapenko
4672bacaef
[ASan] Get rid of asan_mac.h, which contents have been moved to sanitizer_mac.h
...
llvm-svn: 200757
2014-02-04 11:35:59 +00:00
Alexander Potapenko
844a3cf77e
[ASan] Use replace_str=0 and replace_intrin=0 in printf-{2,4}.c to avoid triggering a buffer overflow in strlen and memcpy.
...
This change fixes printf-2.c and printf-4.c under OSX.
llvm-svn: 200756
2014-02-04 11:32:05 +00:00
Dmitry Vyukov
2e1634b69f
tsan: fix darwin Go build
...
llvm-svn: 200755
2014-02-04 11:29:09 +00:00
Justin Bogner
ad560c4c11
CMake: Enable -Werror for the -fno-function-sections check
...
If the -fno-function-sections flag isn't recognized, the compiler
emits a warning. This isn't enough to cause the check to fail, so we
enable -Werror as well.
llvm-svn: 200753
2014-02-04 10:40:46 +00:00
Alexander Potapenko
40fcff653c
[ASan] Fix printf-5.c on OSX: fix a compiler warning, avoid intercepting memcpy (which triggers the error report before printf does).
...
llvm-svn: 200751
2014-02-04 10:36:55 +00:00
Dmitry Vyukov
9244c48b29
tsan: update public Go interface
...
in preparation for https://codereview.appspot.com/55100044
llvm-svn: 200750
2014-02-04 10:35:23 +00:00
Alexander Potapenko
2e7dc60ee3
[ASan] Replace the call to "vname" with "WRAP(vname)" in FORMAT_INTERCEPTOR_IMPL
...
It's incorrect to call the function by its name in the interceptor, because that means WRAP(vname) on Linux and REAL(vname) on OSX.
This patch fixes asan/lit_tests/TestCases/printf-3.c on Mac.
llvm-svn: 200749
2014-02-04 09:35:09 +00:00
Kostya Serebryany
b965a2fa32
[lsan] simplify use_tls_dynamic.cc test
...
llvm-svn: 200748
2014-02-04 09:07:16 +00:00
Dmitry Vyukov
fd0affac37
tsan: add SANITIZER_INTERFACE_ATTRIBUTE to more callbacks
...
so that it's possible to override them from a dynamic library.
llvm-svn: 200747
2014-02-04 08:46:09 +00:00
Alexey Samsonov
d23c79604e
[CMake] Check that compiler supports -fno-function-sections flag
...
llvm-svn: 200746
2014-02-04 08:28:17 +00:00
Dmitry Vyukov
8aaa44c43d
tsan: relax check for errno spoiling more
...
We do not detect errno spoiling for SIGTERM,
because some SIGTERM handlers do spoil errno but reraise SIGTERM,
tsan reports false positive in such case.
It's difficult to properly detect this situation (reraise),
because in async signal processing case (when handler is called directly
from rtl_generic_sighandler) we have not yet received the reraised
signal; and it looks too fragile to intercept all ways to reraise a signal.
llvm-svn: 200742
2014-02-04 07:10:45 +00:00
Kostya Serebryany
f6e085cf89
[sanitizer] make __tls_get_addr interceptor (more) AS-safe. No good test so far, will keep trying.
...
llvm-svn: 200734
2014-02-04 05:22:00 +00:00
Kostya Serebryany
51f135d820
[sanitizer] Handle TLS sizes for glibc < 2.13; As discussed in http://gcc.gnu.org/PR60038 , the hardcoded sizeof(struct thread); patch by Jakub Jelinek
...
llvm-svn: 200733
2014-02-04 04:09:38 +00:00
Alexander Potapenko
f6ff6b0929
[libsanitizer] Workaround for https://code.google.com/p/address-sanitizer/issues/detail?id=261
...
If pthread_get_stacksize_np() returns 512K for the main thread on Mavericks, obtain the stack size from the current stack rlimit.
llvm-svn: 200703
2014-02-03 16:42:29 +00:00
Alexander Potapenko
8d58767b34
[libsanitizer] Follow-up for r200700: add the new header to CMakeLists.txt and make it empty on non-Mac.
...
llvm-svn: 200701
2014-02-03 15:45:03 +00:00
Alexander Potapenko
768e315a74
[ASan] Move GetMacosVersion() to sanitizer_common.
...
llvm-svn: 200700
2014-02-03 15:32:19 +00:00
Evgeniy Stepanov
1fc9e61356
[asan] asan_device_setup.sh: allow overriding adb path.
...
llvm-svn: 200698
2014-02-03 15:12:09 +00:00
Evgeniy Stepanov
756e1c1e4b
[asan] Reinitialize allocator quarantine on activation.
...
This is covered by AddressSanitizer.UAF_* tests in asan_test
with start_deactivated=1.
llvm-svn: 200696
2014-02-03 14:19:08 +00:00
Evgeniy Stepanov
bd2b3177da
[sanitizer] Resubmit r200683: disable -ffunction-sections.
...
llvm-svn: 200686
2014-02-03 11:16:41 +00:00
Evgeniy Stepanov
fe437f0a8f
Revert r200683.
...
-fno-function-sections is broken in Clang.
llvm-svn: 200684
2014-02-03 10:52:53 +00:00
Evgeniy Stepanov
aa0d7dee77
[sanitizer] Disable -ffunction-sections.
...
It breaks when a binary is linked with --gc-sections: parts of sanitizer
interface get thrown away and inaccessible from dlopen-ed libs.
llvm-svn: 200683
2014-02-03 10:15:08 +00:00
Evgeniy Stepanov
04e841c047
[msan] Fix a typo.
...
Spotted by Keno Fischer.
llvm-svn: 200682
2014-02-03 07:27:01 +00:00
Sergey Matveev
c18b36625e
[sanitizer] Partial revert of recent ioctl changes.
...
Some build environments are missing the required headers.
This reverts r200544, r200547, r200551. This does not revert the change that
introduced READWRITE ioctl type.
llvm-svn: 200567
2014-01-31 19:19:45 +00:00
Timur Iskhodzhanov
322ce39e39
Remove /FS as it's auto-added by CMake 2.8.12.1; also, remove /wd4221 as 4221 is a linker warning, not a compiler warning
...
llvm-svn: 200564
2014-01-31 18:25:37 +00:00
Alexander Potapenko
ea4a0dbb8d
[ASan] Implement __sanitizer::InstallDeadlySignalHandlers() and __asan::AsanOnSIGSEGV() on Windows.
...
llvm-svn: 200554
2014-01-31 15:11:11 +00:00
Alexander Potapenko
c6864e9039
[ASan] Add a failing test that demonstrates that ASan currently breaks dead code stripping on Linux.
...
See https://code.google.com/p/address-sanitizer/issues/detail?id=260 for more info.
llvm-svn: 200553
2014-01-31 14:58:54 +00:00
Renato Golin
b760aa6722
Sorting ARM Sources alphabetically
...
llvm-svn: 200552
2014-01-31 14:53:52 +00:00
Evgeniy Stepanov
a78dbe2e6f
[asan] Fix Android build.
...
llvm-svn: 200551
2014-01-31 14:46:37 +00:00
Evgeniy Stepanov
01cd8ae204
[asan] Read extra flags from a system property on activation on Android.
...
llvm-svn: 200550
2014-01-31 14:36:55 +00:00
Alexander Potapenko
36b18dfe64
[libsanitizer] Fix compilation for gotsan.
...
llvm-svn: 200549
2014-01-31 14:30:12 +00:00
Sergey Matveev
dffda4cfec
[sanitizer] Attempt to fix Android build.
...
llvm-svn: 200547
2014-01-31 14:28:32 +00:00
Renato Golin
66e2b70e59
Enable compilation of RT on ARM
...
Adding the ARM RT sources to the CMake files, and enabling some
sanitizers to also build on ARM. This is far from supported or
production quality, but enabling it to build will get us errors
that we can actually fix.
Having said that, the Compiler-RT and the Asan libraries are
know to work on some variations of ARM.
llvm-svn: 200546
2014-01-31 14:25:58 +00:00
Sergey Matveev
6b3397546e
[sanitizer] Support most ioctls from /usr/include/sound/.
...
llvm-svn: 200544
2014-01-31 14:02:21 +00:00
Alexander Potapenko
789e3e1b7c
[ASan] Move the SIGSEGV/SIGBUS handling to sanitizer_common
...
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
2014-01-31 13:10:07 +00:00
Alexey Samsonov
fd99206ee4
[ASan] Run LSan for ASan unit tests only on 64-bit Linux
...
llvm-svn: 200537
2014-01-31 11:44:32 +00:00
Alexander Potapenko
e925e53114
Fix compilation: don't convert NULL to a pointer-incompatible type.
...
llvm-svn: 200536
2014-01-31 11:44:15 +00:00
Alexander Potapenko
d5802fe548
Make signal-related functions use __sanitizer_* structures instead of __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.
llvm-svn: 200535
2014-01-31 11:29:51 +00:00
Dmitry Vyukov
e63a09adb6
tsan: fix Go build
...
Go linker does not like function-static objects.
llvm-svn: 200534
2014-01-31 11:20:55 +00:00