Evgeniy Stepanov
089c066bd6
[msan] Remove leftover MSanDR bits in tests.
...
llvm-svn: 222762
2014-11-25 15:00:23 +00:00
Eric Fiselier
909deebfc8
[compiler-rt] Make the MSAN wmemset intercepter call wmemset instead of memset. Fixes PR 21579
...
Summary:
Exactly what the title says. I've tested this change against the libc++ test failures and it solves all of them. The check-msan rule also still passes.
I'm not sure why it called memset originally.
I can add tests if requested but currently there are no tests involving wide chars and they are a c++11 features.
Reviewers: kcc, eugenis
Reviewed By: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6352
llvm-svn: 222673
2014-11-24 18:17:04 +00:00
Evgeniy Stepanov
7555f5ed1f
[msan] Remove MSanDR and supporting code.
...
MSanDR is a dynamic instrumentation tool that can instrument the code
(prebuilt libraries and such) that could not be instrumented at compile time.
This code is unused (to the best of our knowledge) and unmaintained, and
starting to bit-rot.
llvm-svn: 222232
2014-11-18 10:33:15 +00:00
Richard Trieu
b6b141d601
delete => delete[] for arrays.
...
llvm-svn: 221769
2014-11-12 04:19:57 +00:00
Kuba Brecka
14c0c5901d
[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, let's rename it to append_list_if
...
Doing s/append_if/append_list_if/, no functional change.
http://reviews.llvm.org/D5739
llvm-svn: 219860
2014-10-15 22:47:54 +00:00
Evgeniy Stepanov
37e069c2ac
[msan] Fix fcvt interceptor.
...
fcvt() result can be heap-allocated and must be unpoisoned.
llvm-svn: 215106
2014-08-07 12:45:55 +00:00
Alexey Samsonov
d6906e4ffe
[MSan] Fix strncpy interceptor
...
llvm-svn: 213590
2014-07-22 00:10:08 +00:00
Evgeniy Stepanov
eb893a1fd6
[msan] Fix out of bounds access in origin copying.
...
llvm-svn: 212534
2014-07-08 14:15:23 +00:00
Alexey Samsonov
91bb8e0e3a
Generalize sanitizer allocator public interface.
...
Introduce new public header <sanitizer/allocator_interface.h> and a set
of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc.
that will eventually replace their tool-specific equivalents
(__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific
functions are now deprecated and implemented as stubs redirecting
to __sanitizer_ versions (which are implemented differently in each tool).
Replace all uses of __xsan_ versions with __sanitizer_ versions in unit
and lit tests.
llvm-svn: 212469
2014-07-07 17:39:31 +00:00
Alexey Samsonov
e3a401a12b
[MSan] Fixup r212082: enable tests for _mm_ intrinsics if and only if the
...
unit test source file is compiled with Clang.
llvm-svn: 212121
2014-07-01 19:58:41 +00:00
Alexey Samsonov
c0fda339e2
Add the way to disable MSan unit tests for _mm_* intrinsics
...
llvm-svn: 212082
2014-07-01 01:38:52 +00:00
Evgeniy Stepanov
8717fec9af
[msan] Fix origin copying.
...
Conditions for the first and the last origin value in range were wrong.
llvm-svn: 211585
2014-06-24 11:50:26 +00:00
Evgeniy Stepanov
4ea1647e8b
[msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.
...
llvm-svn: 211156
2014-06-18 12:02:29 +00:00
Evgeniy Stepanov
9959915890
[msan] Intercept __strto*_internal.
...
This should fix strtoimax/strtoumax on newer glibc.
https://code.google.com/p/memory-sanitizer/issues/detail?id=36
llvm-svn: 210463
2014-06-09 10:41:22 +00:00
Evgeniy Stepanov
66c6a18d39
[msan] Add a test for mmx.packuswb.
...
llvm-svn: 210458
2014-06-09 08:58:41 +00:00
Evgeniy Stepanov
aaaf74f9fb
[msan] Simplify tests.
...
llvm-svn: 210457
2014-06-09 08:57:40 +00:00
Evgeniy Stepanov
d425a2b169
[msan] Handle x86 vector pack intrinsics.
...
llvm-svn: 210020
2014-06-02 12:31:44 +00:00
Evgeniy Stepanov
208aae8ee0
[msan] Chained origins re-design.
...
Generalize StackDepot and create a new specialized instance of it to
efficiently (i.e. without duplicating stack trace data) store the
origin history tree.
This reduces memory usage for chained origins roughly by an order of
magnitude.
Most importantly, this new design allows us to put two limits on
stored history data (exposed in MSAN_OPTIONS) that help avoid
exponential growth in used memory on certain workloads.
See comments in lib/msan/msan_origin.h for more details.
llvm-svn: 209284
2014-05-21 09:02:13 +00:00
Alexey Samsonov
eacb4d8417
[CMake] Use ExternalProject to build MSan-ified version of libcxx for unit tests.
...
This change lets MSan rely on libcxx's own build system instead of manually
compiling its sources and setting up all the necessary compile flags. It would
also simplify compiling libcxx with another sanitizers (in particular, TSan).
The tricky part is to make sure libcxx is reconfigured/rebuilt when Clang or
MSan runtime library is changed. "clobber" step used in this patch works well
for me, but it's possible it would break for other configurations - will
watch the buildbots.
llvm-svn: 208451
2014-05-09 22:11:03 +00:00
Evgeniy Stepanov
474011d55d
[msan] Add missing quotes.
...
llvm-svn: 206589
2014-04-18 13:03:54 +00:00
Evgeniy Stepanov
191ebd874f
[msan] Run msan_test in the new with-calls mode.
...
llvm-svn: 206587
2014-04-18 12:19:28 +00:00
Evgeniy Stepanov
9ce9a6cdf6
[msan] Intercept wcsftime().
...
llvm-svn: 206179
2014-04-14 14:59:42 +00:00
Evgeniy Stepanov
f653cda269
[msan] Introduce MsanThread. Move thread-local allocator cache out of TLS.
...
This reduces .tbss from 109K down to almost nothing.
llvm-svn: 205618
2014-04-04 09:47:41 +00:00
Evgeniy Stepanov
a55fcd35e9
[msan] Precise origin handling in __unaligned_(load|store)*.
...
llvm-svn: 205412
2014-04-02 11:06:35 +00:00
Evgeniy Stepanov
8dbf3faa16
[msan] clang-format several unit tests
...
llvm-svn: 205410
2014-04-02 09:17:55 +00:00
Evgeniy Stepanov
86a4d2c32b
[sanitizer] Intercept fgetpwent / fgetgrent.
...
These interceptors require deep unpoisoning of return values.
While at it, we do the same for all other pw/gr interceptors to
reduce dependency on libc implementation details.
llvm-svn: 205004
2014-03-28 13:03:55 +00:00
Evgeniy Stepanov
74e77756ef
[sanitizer] Intercept getpwent/getgrent.
...
llvm-svn: 205000
2014-03-28 10:56:07 +00:00
Evgeniy Stepanov
9dcd5a353a
[msan] Intercept several malloc-related functions.
...
llvm-svn: 204923
2014-03-27 13:29:29 +00:00
Evgeniy Stepanov
1382fabd97
[msan] Enable SelectPartial test.
...
Fixed in r204716.
llvm-svn: 204717
2014-03-25 13:09:14 +00:00
Evgeniy Stepanov
517ff05ffb
[msan] Fix compiler warning in msan_test.cc.
...
llvm-svn: 204708
2014-03-25 10:03:39 +00:00
Evgeniy Stepanov
90384ad60e
[msan] A disabled test for inexact "select" instrumentation.
...
llvm-svn: 204707
2014-03-25 09:36:15 +00:00
Alexey Samsonov
c41ca6d31a
[CMake] Rename the variable
...
llvm-svn: 204602
2014-03-24 13:29:20 +00:00
Alexey Samsonov
1847401332
[CMake] Respect CMAKE_CXX_FLAGS in custom clang_compile commands
...
llvm-svn: 204593
2014-03-24 09:42:12 +00:00
Alexey Samsonov
8c956460d3
Make MSan unittest -Werror=sign-compare clean
...
llvm-svn: 204592
2014-03-24 09:41:11 +00:00
Alexey Samsonov
17703c1092
[CMake] Build sanitizer unit tests with -std=c++11
...
llvm-svn: 204234
2014-03-19 13:57:33 +00:00
Evgeniy Stepanov
9fa9a49853
[msan] Test for aggregates passing through ellipsis.
...
llvm-svn: 203795
2014-03-13 13:18:15 +00:00
Alexey Samsonov
32956d651a
[CMake] Make append_if semantics similar to those used in LLVM
...
llvm-svn: 203773
2014-03-13 09:31:36 +00:00
Alexey Samsonov
6dece3c99f
Add common interceptors for memchr/memrchr
...
llvm-svn: 202972
2014-03-05 13:25:32 +00:00
Alexey Samsonov
d964e7cd81
[CMake] Test for libdl and libpthread presence
...
llvm-svn: 202847
2014-03-04 13:28:21 +00:00
Evgeniy Stepanov
f7abc8dff6
[msan] Tests for X86 SIMD bitshift intrinsic support.
...
llvm-svn: 202713
2014-03-03 13:52:36 +00:00
Alexey Samsonov
11705b2f10
[CMake] break dependency between unit tests and runtimes in standalone build
...
llvm-svn: 201778
2014-02-20 12:03:56 +00:00
Alexey Samsonov
8434e60f7e
Move MSan lit-tests under test/msan
...
llvm-svn: 201412
2014-02-14 13:02:58 +00:00
Evgeniy Stepanov
a21280307f
[sanitizer] Fix getpwuid_r (and similar) interceptors missing one of the arguments.
...
llvm-svn: 201410
2014-02-14 12:32:15 +00:00
Evgeniy Stepanov
05938a23f5
[sanitizer] Use mmap to zero-fill large shadow regions.
...
This is covered by existing ASan test.
This does not change anything for TSan by default (but provides a flag to
change the threshold size).
Based on a patch by florent.bruneau here:
https://code.google.com/p/address-sanitizer/issues/detail?id=256
llvm-svn: 201400
2014-02-14 11:41:26 +00:00
Sergey Matveev
1394f2da85
[msan] Rewrite strto* interceptors and add a few more.
...
Express the strto* interceptors though macros. This removes a lot of
duplicate code and fixes a couple of copypasto bugs (where "res" was declared of
a different type than the actual return type). Also, add a few more interceptors
for strto*_l.
llvm-svn: 200316
2014-01-28 13:45:58 +00:00
Evgeniy Stepanov
0b09c623c1
[msan] Replace assert() with GTest ASSERT_* in msan_test.
...
llvm-svn: 200293
2014-01-28 08:51:39 +00:00
Evgeniy Stepanov
3ee789cbbb
[msan] Temporarily disable two tests that are failing with new glibc.
...
llvm-svn: 198919
2014-01-10 07:34:16 +00:00
Evgeniy Stepanov
cb98c5f6f0
[msan] Relax gethostbyname_r test condition.
...
Apparently, its return value depends on the glibc version.
llvm-svn: 197390
2013-12-16 15:01:31 +00:00
Evgeniy Stepanov
43fc44007d
[msan] Fix gethostbyname_r and similar interceptors.
...
*h_errno is written not on success, but on failure.
In fact, it seems like it can be written even when return value signals
success, so we just unpoison it in all cases.
llvm-svn: 197383
2013-12-16 13:24:33 +00:00
Evgeniy Stepanov
3158ec4002
[msan] Fix strncat interceptor, add missing tests.
...
llvm-svn: 197244
2013-12-13 16:31:59 +00:00
Evgeniy Stepanov
584fd96e9e
[msan] Unpoison memory that is returned to the OS and flush its shadow.
...
llvm-svn: 195244
2013-11-20 12:51:14 +00:00
Evgeniy Stepanov
bfb2016c83
[msan] Fix origin tracking in unaligned load/store.
...
llvm-svn: 195130
2013-11-19 14:47:56 +00:00
Evgeniy Stepanov
1c8c3fe4b4
[msan] Fix a very unfortunate typo in origin copying.
...
It was causing randomly missing origins.
llvm-svn: 194036
2013-11-05 01:24:38 +00:00
Evgeniy Stepanov
a6b5eec757
[sanitizer] Intercept strptime.
...
llvm-svn: 193903
2013-11-02 01:01:35 +00:00
Evgeniy Stepanov
365bd0c88c
[msan] Intercept memccpy.
...
llvm-svn: 193897
2013-11-01 23:49:48 +00:00
Evgeniy Stepanov
a7add488ae
[msan] Disable mlock/mlockall to work around a linux kernel bug.
...
The same logic is present in ASan and TSan.
llvm-svn: 193755
2013-10-31 15:51:22 +00:00
Evgeniy Stepanov
0bd1f00ec6
[sanitizer] Intercept drand48_r, lrand48_r.
...
llvm-svn: 193655
2013-10-29 22:25:27 +00:00
Evgeniy Stepanov
bf60342d47
[sanitizer] Intercept sincos, remquo, lgamma, lgamma_r.
...
llvm-svn: 193645
2013-10-29 19:49:35 +00:00
Evgeniy Stepanov
451c8de2d8
[msan] Intercept shmat.
...
llvm-svn: 193581
2013-10-29 02:48:49 +00:00
Evgeniy Stepanov
94042e1ff2
[sanitizer] Intercept tmpnam, tmpnam_r, tempnam.
...
llvm-svn: 193415
2013-10-25 15:51:48 +00:00
Evgeniy Stepanov
2acb2470f9
[sanitizer] Remove pthread_attr_getstackaddr interceptor.
...
The function is deprecated.
llvm-svn: 193409
2013-10-25 14:27:00 +00:00
Evgeniy Stepanov
07507ffab4
[msan] Zerofill initstate_r buffer in random_r test.
...
llvm-svn: 193406
2013-10-25 13:03:20 +00:00
Evgeniy Stepanov
c2b6cb0747
[sanitizer] Intercept pthread_attr_get*.
...
llvm-svn: 193405
2013-10-25 13:01:31 +00:00
Evgeniy Stepanov
be9cdbb58c
[sanitizer] Intercept random_r.
...
llvm-svn: 193396
2013-10-25 08:58:13 +00:00
Evgeniy Stepanov
f312b480e2
[sanitizer] Intercept shmctl.
...
llvm-svn: 193348
2013-10-24 14:47:34 +00:00
Evgeniy Stepanov
d280ee48e8
[msan] Fix invalid origin copying.
...
Origin copying may destroy valid origin info. This is caused by
__msan_copy_origin widening the address range to the nearest 4-byte aligned
addresses both on the left and on the right. If the target buffer is
uninitialized and the source is fully initialized, this will result in
overriding valid origin of target buffer with stale (possibly 0) origin of the
source buffer.
With this change the widened origin is copied only if corresponding shadow
values are non zero.
llvm-svn: 193338
2013-10-24 11:56:03 +00:00
Evgeniy Stepanov
3e6064f9d2
[sanitizer] Intercept ether_* functions.
...
llvm-svn: 193241
2013-10-23 13:57:47 +00:00
Evgeniy Stepanov
3cb9df042e
[sanitizer] Move statfs/fstatfs to common interceptors and add statvfs/fstatvfs.
...
llvm-svn: 192965
2013-10-18 11:14:16 +00:00
Evgeniy Stepanov
70d5abfba2
[sanitizer] Intercept getmntent, getmntent_r.
...
llvm-svn: 192959
2013-10-18 09:41:43 +00:00
Evgeniy Stepanov
4bbf273173
[sanitizer] Fix unpoisoning of msghdr::msg_name in recvmsg interceptor.
...
llvm-svn: 192886
2013-10-17 11:32:30 +00:00
Alexey Samsonov
bc7c87a8cb
[Sanitizer] Move pthread_cond_signal and pthread_cond_broadcast to common interceptors
...
llvm-svn: 192876
2013-10-17 09:24:03 +00:00
Alexey Samsonov
edecc38395
Make some pthread_mutex_* and pthread_cond_* interceptors common.
...
Reviewers: eugenis, dvyukov
Reviewed By: dvyukov
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1937
llvm-svn: 192774
2013-10-16 08:20:31 +00:00
Evgeniy Stepanov
7a2bbc30a2
[msan] Remove CallocOverflow test.
...
This behaviour depends on MSAN_OPTIONS.
All interesting combinations are covered by lit_tests/allocator_returns_null.cc.
llvm-svn: 192691
2013-10-15 12:20:16 +00:00
Evgeniy Stepanov
7aacd9c172
[msan] Intercept strto(d|f|ld)_l and glibc-specific __strto(d|f|ld)_l.
...
llvm-svn: 192583
2013-10-14 11:52:40 +00:00
Evgeniy Stepanov
c907a60ffb
[sanitizer] Fix localtime and gmtime interceptors to clean tm->tm_zone.
...
llvm-svn: 191827
2013-10-02 14:30:03 +00:00
Evgeniy Stepanov
8f27f6b549
[sanitizer] A bunch of libc interceptors.
...
sigwait
sigwaitinfo
sigtimedwait
sigemptyset
sigfillset
sigpending
sigprocmask
llvm-svn: 191374
2013-09-25 14:47:43 +00:00
Evgeniy Stepanov
2761ee0409
[sanitizer] Intercept wordexp.
...
llvm-svn: 191305
2013-09-24 14:38:22 +00:00
Evgeniy Stepanov
842fa3f80d
[msan] Intercept fstatat / fstatat64.
...
llvm-svn: 190306
2013-09-09 13:40:41 +00:00
Kostya Serebryany
6c5b034d7b
[msan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
...
llvm-svn: 190132
2013-09-06 10:58:55 +00:00
Evgeniy Stepanov
f9ddb43975
[msan] A regression test for r189785.
...
llvm-svn: 189786
2013-09-03 10:05:45 +00:00
Evgeniy Stepanov
e3eaa7bb35
[msan] Intercept memalign, valloc, pvalloc.
...
PR17039
llvm-svn: 189750
2013-09-02 09:24:53 +00:00
Evgeniy Stepanov
82185980c4
[msan] A test for ppoll() interceptor.
...
llvm-svn: 189339
2013-08-27 11:10:20 +00:00
Evgeniy Stepanov
0d13c707d5
[msan] Extend VAArgTLSOverwrite test.
...
This test now covers LLVM r189104.
llvm-svn: 189105
2013-08-23 12:13:18 +00:00
Evgeniy Stepanov
64cace0687
[sanitizer] Intercept poll/ppoll.
...
llvm-svn: 188177
2013-08-12 13:19:53 +00:00
Evgeniy Stepanov
98c39a184e
[sanitizer] Intercept getgroups.
...
llvm-svn: 188167
2013-08-12 11:01:40 +00:00
Evgeniy Stepanov
233455cba8
[sanitizer] Intercept strerror and strerror_r.
...
llvm-svn: 187978
2013-08-08 11:44:05 +00:00
Evgeniy Stepanov
04b7bff1fe
[sanitizer] Intercept sched_getaffinity.
...
Re-applying with a more reliable test case.
llvm-svn: 187876
2013-08-07 09:10:16 +00:00
David Blaikie
787e2b6499
Revert "[sanitizer] Intercept sched_getaffinity."
...
This reverts commit r187788.
The test case is unreliable (as the test may be run in a situation in
which it has no affinity with cpu0). This can be recommitted with a more
reliable test - possibly using CPU_COUNT != 0 instead (I wasn't entirely
sure that a process was guaranteed to have at least one affinity, though
it seems reasonable, or I'd have made the change myself).
llvm-svn: 187841
2013-08-07 00:37:26 +00:00
Evgeniy Stepanov
03c0281a17
[sanitizer] Fix NULL arg handling in setitimer/getitimer interceptors.
...
llvm-svn: 187789
2013-08-06 09:54:33 +00:00
Evgeniy Stepanov
9f05e5e533
[sanitizer] Intercept sched_getaffinity.
...
llvm-svn: 187788
2013-08-06 09:29:01 +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
90daaf9132
[msan] Fix unused function warning in the tests.
...
llvm-svn: 187648
2013-08-02 09:09:02 +00:00
Evgeniy Stepanov
5dbedf6c2a
[msan] Intercept setenv, putenv.
...
llvm-svn: 187575
2013-08-01 11:14:14 +00:00
Evgeniy Stepanov
807e131261
[msan] Intercept pthread_join.
...
llvm-svn: 187413
2013-07-30 12:54:34 +00:00
Evgeniy Stepanov
da9fd25603
[msan] Intercept confstr.
...
llvm-svn: 187412
2013-07-30 12:46:59 +00:00
Alexey Samsonov
9916aa2d95
[Sanitizer] move strcpy and strncpy to common interceptors
...
llvm-svn: 186408
2013-07-16 12:51:53 +00:00
Alexey Samsonov
fde429ba69
[Sanitizer] Revert some parts of r186109 related to mbstowcs-and-friends interceptors
...
llvm-svn: 186155
2013-07-12 11:59:58 +00:00
Evgeniy Stepanov
9240838655
[sanitizer] More checks in mbstowcs-like interceptors.
...
llvm-svn: 186004
2013-07-10 14:17:46 +00:00
Evgeniy Stepanov
123fdb3413
[sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.
...
llvm-svn: 186002
2013-07-10 14:01:51 +00:00
Evgeniy Stepanov
77ef78a0a5
[sanitizer] Intercept realpath and canonicalize_file_name.
...
Handle realpath(path, NULL) form.
llvm-svn: 185921
2013-07-09 09:53:37 +00:00
Evgeniy Stepanov
628d727749
[msan] Intercept pthread_key_create.
...
llvm-svn: 185693
2013-07-05 12:31:07 +00:00
Evgeniy Stepanov
db615c186f
[sanitizer] More interceptors.
...
bcopy
strtoimax, strtoumax
mbstowcs, mbsrtowcs, mbsnrtowcs
wcstombs, wcsrtombs, wcsnrtombs
llvm-svn: 185624
2013-07-04 13:19:41 +00:00
Evgeniy Stepanov
aa23bd83e5
[msan] Intercept mempcpy, wmempcpy.
...
llvm-svn: 185431
2013-07-02 14:49:24 +00:00
Evgeniy Stepanov
165d759a6a
[sanitizer] Intercept mbtowc, mbrtowc, get_current_dir_name.
...
Move getcwd to common interceptors.
llvm-svn: 185424
2013-07-02 13:34:44 +00:00
Evgeniy Stepanov
654688bed5
[msan] Intercept stpcpy.
...
llvm-svn: 185340
2013-07-01 15:19:37 +00:00
Evgeniy Stepanov
8a4e24ea8b
[sanitizer] Intercept getnameinfo.
...
llvm-svn: 185338
2013-07-01 13:51:31 +00:00
Evgeniy Stepanov
f5cae53057
[msan] Optionally disable 2 tests (dlopen & gethostbyname).
...
llvm-svn: 185076
2013-06-27 13:21:00 +00:00
Evgeniy Stepanov
06d6c25141
[sanitizer] readdir and readdir_r interceptors.
...
llvm-svn: 184950
2013-06-26 15:00:53 +00:00
Evgeniy Stepanov
60d964d4f2
[sanitizer] Intercept sysinfo.
...
llvm-svn: 184739
2013-06-24 14:25:33 +00:00
Evgeniy Stepanov
02a7460d12
[sanitizer] Intercept inet_aton.
...
llvm-svn: 184735
2013-06-24 13:56:14 +00:00
Evgeniy Stepanov
0e8053af08
[sanitizer] Intercept readv, preadv, writev, pwritev.
...
llvm-svn: 184717
2013-06-24 10:43:23 +00:00
Evgeniy Stepanov
b58b72e151
[msan] Intercept (v)asprintf.
...
llvm-svn: 184545
2013-06-21 13:32:26 +00:00
Alexey Samsonov
dd489a4e15
[MSan] don't add msan unit tests to check-msan command if libcxx is not checked out
...
llvm-svn: 183641
2013-06-10 09:09:40 +00:00
Evgeniy Stepanov
53c8c13bf1
[msan] Implement __sanitizer_unaligned_*.
...
llvm-svn: 183221
2013-06-04 13:08:36 +00:00
Evgeniy Stepanov
677003140c
[sanitizer] Fix getaddrinfo interceptor to use the actual returned sockaddr size.
...
llvm-svn: 182852
2013-05-29 12:33:31 +00:00
Evgeniy Stepanov
fc708db4c1
[sanitizer] Intercept getpeername.
...
llvm-svn: 182844
2013-05-29 11:49:25 +00:00
Evgeniy Stepanov
f28217ad0e
[sanitizer] modf/modff/modfl interceptors.
...
llvm-svn: 182838
2013-05-29 10:03:11 +00:00
Evgeniy Stepanov
08f662845d
[sanitizer] Share TSan accept & accept4 interceptors with other sanitizers.
...
llvm-svn: 182835
2013-05-29 09:09:58 +00:00
Evgeniy Stepanov
b978627cb8
[sanitizer] Intercept getsockopt.
...
llvm-svn: 182574
2013-05-23 11:38:08 +00:00
Evgeniy Stepanov
ab25369d04
[sanitizer] Interceptors for gethostbyname and friends.
...
llvm-svn: 182573
2013-05-23 11:10:23 +00:00
Evgeniy Stepanov
97aea34b54
[msan] Intercept getsockname.
...
llvm-svn: 182475
2013-05-22 13:46:22 +00:00
Evgeniy Stepanov
1d2f22825d
[msan] Replace GetArgv hack with something that is slightly better.
...
llvm-svn: 182359
2013-05-21 08:56:22 +00:00
Evgeniy Stepanov
970be35808
[sanitizer] Intercept pthread_getschedparam.
...
llvm-svn: 182353
2013-05-21 08:12:08 +00:00
Evgeniy Stepanov
ff6728f2f8
[msan] Unpoison dlpi_name in dl_iterate_phdr interceptor.
...
llvm-svn: 182093
2013-05-17 12:51:13 +00:00
Evgeniy Stepanov
87c6ec7cfe
[msan] Intercept dl_iterate_phdr.
...
llvm-svn: 182004
2013-05-16 13:00:25 +00:00
Evgeniy Stepanov
44b75efab4
[sanitizer] Intercept inet_pton and inet_ntop.
...
llvm-svn: 180107
2013-04-23 14:05:15 +00:00
Evgeniy Stepanov
455abf4872
[msan] Unpoison the result of posix_memalign.
...
llvm-svn: 180101
2013-04-23 13:27:36 +00:00
Evgeniy Stepanov
3076ba0a08
[sanitizer] Intercept getgrnam{_r}, getgrgid{_r}.
...
llvm-svn: 180091
2013-04-23 12:01:20 +00:00
Evgeniy Stepanov
0cd7cf8217
[msan] Allow clock_getres(, 0).
...
llvm-svn: 180090
2013-04-23 11:48:31 +00:00
Evgeniy Stepanov
d1dae90bf2
[msan] Fix gcc build of msan_test.
...
llvm-svn: 179594
2013-04-16 14:09:47 +00:00
Evgeniy Stepanov
b0d786798c
[msan] Fix sigaction test.
...
Restore SIGPROF handler to the original state after the test.
llvm-svn: 179524
2013-04-15 13:35:05 +00:00
Alexey Samsonov
1a345ad502
[MSan] don't build tests with -fPIE/-pie, as these flags are implied by -fsanitize=memory now
...
llvm-svn: 179366
2013-04-12 07:14:04 +00:00
Evgeniy Stepanov
b4eac2f810
[msan] Interceptors for pipe2 and socketpair.
...
llvm-svn: 179022
2013-04-08 13:45:12 +00:00
Evgeniy Stepanov
7ba7207f1d
[msan] Intercept time().
...
llvm-svn: 179002
2013-04-08 08:25:22 +00:00
Evgeniy Stepanov
e7a7a9b972
[msan] Fix sigaction interceptor.
...
llvm-svn: 178868
2013-04-05 12:58:07 +00:00
Evgeniy Stepanov
1f8b3538b4
[msan] Unpoison siginfo_t and ucontext_t in signal handlers.
...
Add wrappers for all user signal handlers to unpoison the handler's arguments.
llvm-svn: 178754
2013-04-04 08:22:52 +00:00
Evgeniy Stepanov
f8213b4eb3
[sanitizer] More interceptors.
...
getpwnam, getpwuid, getpwnam_r, getpwuid_r, clock_getres, clock_gettime,
clock_settime, getitimer, setitimer, sigaction (MSan).
llvm-svn: 178465
2013-04-01 14:47:21 +00:00
Evgeniy Stepanov
ecbf64648f
[msan] Handle dlopen() failure in dlopen interceptor.
...
llvm-svn: 177728
2013-03-22 11:59:49 +00:00
Evgeniy Stepanov
93a842bd1f
[msan] Move test main and gtest include to separate files.
...
llvm-svn: 177718
2013-03-22 09:01:26 +00:00
Evgeniy Stepanov
bfe9df221d
[msan] Place dlopen in an anon namespace.
...
llvm-svn: 177716
2013-03-22 08:49:36 +00:00
Evgeniy Stepanov
b4a218db34
[sanitizer] Don't adjust the size of the user-allocated stack.
...
Moved this code to sanitizer_common.
llvm-svn: 177383
2013-03-19 09:30:52 +00:00
Evgeniy Stepanov
c6bce93591
[msan] Intercept readdir64.
...
llvm-svn: 177065
2013-03-14 12:49:23 +00:00
Evgeniy Stepanov
4062a396c7
[msan] Fix a typo in test.
...
llvm-svn: 177059
2013-03-14 11:58:13 +00:00
Evgeniy Stepanov
231894a902
[sanitizer] Intercept frexp and friends.
...
llvm-svn: 177056
2013-03-14 11:34:39 +00:00
Evgeniy Stepanov
ead6cf7c72
[msan] Intercept __strdup, strndup, __strndup.
...
llvm-svn: 177052
2013-03-14 11:10:36 +00:00
Evgeniy Stepanov
98f5ea0dba
[msan] Increase stack size as required.
...
Adjust stack size in pthread_attr_t when the app-requested size does not fit MSan TLS.
llvm-svn: 176939
2013-03-13 09:01:40 +00:00
Reid Kleckner
c9d382b5a4
[msan] intercept dlopen and clear shadow for it
...
Summary:
The loader does not call mmap() through the PLT because it has to
bootstrap the process before libc is present. Hooking dlopen() isn't
enough either because the loader runs module initializers before
returning, and they could run arbitrary msan instrumented code.
If msandr is present, then we can intercept the mmaps from dlopen at the
syscall layer and clear the shadow there. If msandr is missing, we
clear the shadow after dlopen() and hope any initializers are trivial.
Reviewers: eugenis
CC: kcc, llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D509
llvm-svn: 176818
2013-03-11 18:07:42 +00:00
Evgeniy Stepanov
ea61d08185
[sanitizer] Add interceptors for localtime and friends.
...
llvm-svn: 175499
2013-02-19 09:19:16 +00:00
Evgeniy Stepanov
e676f66fe3
[msan] Allow zero buf pointer in getcwd() interceptor.
...
llvm-svn: 174970
2013-02-12 14:36:22 +00:00
Evgeniy Stepanov
257274e754
[msan] Lit tests for MemorySanitizer.
...
Build system setup for MSan lit tests (build with freshly-built clang, run,
check output) - a nearly exact copy from ASan.
First 2 lit tests for MSan.
llvm-svn: 174876
2013-02-11 11:34:26 +00:00