Evgeniy Stepanov
bfdb9b2ec6
[msan] Sanity check for non-PIE.
...
llvm-svn: 194370
2013-11-11 09:27:20 +00:00
Alexey Samsonov
b3d939902a
[Sanitizer] Make StackTrace::Unwind the only public way to unwind a stack trace.
...
llvm-svn: 194196
2013-11-07 07:28:33 +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
Alexey Samsonov
5dc6cff06a
[Sanitizer] Unify summary reporting across all sanitizers.
...
This change unifies the summary printing across sanitizers:
now each tool uses specific version of ReportErrorSummary() method,
which deals with symbolization of the top frame and formatting a
summary message. This change modifies the summary line for ASan+LSan mode:
now the summary mentions "AddressSanitizer" instead of "LeakSanitizer".
llvm-svn: 193864
2013-11-01 17:02:14 +00:00
Evgeniy Stepanov
170d70be68
[msan] Check that address is an app region before printing shadow.
...
llvm-svn: 193863
2013-11-01 15:53:25 +00:00
Evgeniy Stepanov
2335879ff1
[sanitizer] Enhance io_submti syscall handler.
...
llvm-svn: 193848
2013-11-01 01:20:39 +00:00
Alexey Samsonov
4708c5912b
Consistently use StackTrace::PrintStack in ASan, LSan and MSan
...
llvm-svn: 193834
2013-11-01 00:19:46 +00:00
Alexey Samsonov
627e2c0dd7
[Sanitizer] Add Symbolizer::AddHooks() and use it in TSan and MSan.
...
Summary:
TSan and MSan need to know if interceptor was called by the
user code or by the symbolizer and use pre- and post-symbolization hooks
for that. Make Symbolizer class responsible for calling these hooks instead.
This would ensure the hooks are only called when necessary (during
in-process symbolization, they are not needed for out-of-process) and
save specific sanitizers from tracing all places in the code where symbolization
will be performed.
Reviewers: eugenis, dvyukov
Reviewed By: eugenis
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2067
llvm-svn: 193807
2013-10-31 21:44:07 +00:00
Evgeniy Stepanov
13322c6eda
[msan] Intercept dlerror.
...
llvm-svn: 193760
2013-10-31 16:58:44 +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
1cb37c4ee5
[sanitizer] Intercept getline, getdelim.
...
llvm-svn: 193730
2013-10-31 01:17:41 +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
477f8b73a5
[sanitizer] Ptrace syscall handler.
...
llvm-svn: 193633
2013-10-29 17:59:45 +00:00
Dmitry Vyukov
3e8432ee6c
tsan/asan: support pthread_setname_np to set thread names
...
llvm-svn: 193602
2013-10-29 10:30:39 +00:00
Alexey Samsonov
a687d2593f
[Sanitizer] Simplify StackTrace::PrintStack interface: prefer common flags to turn on/off the symbolization
...
llvm-svn: 193587
2013-10-29 05:31:25 +00:00
Evgeniy Stepanov
451c8de2d8
[msan] Intercept shmat.
...
llvm-svn: 193581
2013-10-29 02:48:49 +00:00
Evgeniy Stepanov
d828208713
[msan] Fix a typo and enable poison_in_free flag.
...
llvm-svn: 193529
2013-10-28 18:53:37 +00:00
Dmitry Vyukov
cf7259c094
asan/msan: separate different report blocks with new lines
...
this makes the reports consistent with tsan, and much more readable.
llvm-svn: 193520
2013-10-28 13:05:32 +00:00
Peter Collingbourne
791e65dcfb
Overhaul the symbolizer interface.
...
This moves away from creating the symbolizer object and initializing the
external symbolizer as separate steps. Those steps now always take place
together.
Sanitizers with a legacy requirement to specify their own symbolizer path
should use InitSymbolizer to initialize the symbolizer with the desired
path, and GetSymbolizer to access the symbolizer. Sanitizers with no
such requirement (e.g. UBSan) can use GetOrInitSymbolizer with no need for
initialization.
The symbolizer interface has been made thread-safe (as far as I can
tell) by protecting its member functions with mutexes.
Finally, the symbolizer interface no longer relies on weak externals, the
introduction of which was probably a mistake on my part.
Differential Revision: http://llvm-reviews.chandlerc.com/D1985
llvm-svn: 193448
2013-10-25 23:03:29 +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
ced9fede02
[msan] Separate access and origin blocks in msan reports with an extra whiteline.
...
llvm-svn: 193401
2013-10-25 11:17:54 +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
7edb87a92c
[msan] Unpoison errno in common interceptors.
...
llvm-svn: 193343
2013-10-24 13:20: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
f2fd459a5b
[msan] Change wording in the invalid origin message.
...
llvm-svn: 193335
2013-10-24 11:52:48 +00:00
Evgeniy Stepanov
3e6064f9d2
[sanitizer] Intercept ether_* functions.
...
llvm-svn: 193241
2013-10-23 13:57:47 +00:00
Evgeniy Stepanov
2794c47243
[msan] Drain allocator cache when leaving thread.
...
llvm-svn: 193163
2013-10-22 14:31:30 +00:00
Evgeniy Stepanov
0229c09d43
[sanitizer] Intercept initgroups.
...
llvm-svn: 193158
2013-10-22 12:24:48 +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
Evgeniy Stepanov
8df08225e5
[msan] Handle origins in __sanitizer_unaligned_(load|store)*.
...
llvm-svn: 192776
2013-10-16 08:25:13 +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
Dmitry Vyukov
7502a3a90c
tsan: use verbosity flag in sanitizer_common code directly
...
now it's available from common_flags()
llvm-svn: 192705
2013-10-15 14:12:26 +00:00
Dmitry Vyukov
52ca74ec61
tsan: move verbosity flag to CommonFlags
...
llvm-svn: 192701
2013-10-15 13:28:51 +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
113c646c56
[msan] Implement allocator_may_return_null=1 in MemorySanitizer.
...
llvm-svn: 192687
2013-10-15 11:33:48 +00:00
Evgeniy Stepanov
251d1e5d21
[msan] Test for r192599.
...
llvm-svn: 192600
2013-10-14 15:17:05 +00:00
Evgeniy Stepanov
7d7768e032
[msan] Remove a long-outdated comment.
...
llvm-svn: 192592
2013-10-14 13:30:40 +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
054d533d8d
[msan] Regression test for r192575.
...
llvm-svn: 192577
2013-10-14 09:53:39 +00:00
Alexey Samsonov
9d8385453b
[Sanitizer] Simplify StackTrace::FastUnwindStack interface and fix a bug with one-frame stack traces
...
llvm-svn: 192428
2013-10-11 09:58:30 +00:00
Alexey Samsonov
f2b811a618
Refactor the usage of strip_path_prefix option and make it more consistent across sanitizers
...
llvm-svn: 191943
2013-10-04 08:55:03 +00:00
Dmitry Vyukov
19a1302046
asan/msan: fix "unused function 'OnExit'" warning
...
llvm-svn: 191904
2013-10-03 15:43:59 +00:00
Dmitry Vyukov
fdfb2ade8f
asan/msan/tsan: move _exit interceptor to common interceptors
...
llvm-svn: 191903
2013-10-03 15:22:29 +00:00
Dmitry Vyukov
83ebd022d7
tsan: fix false positive in localtime()
...
llvm-svn: 191899
2013-10-03 14:12:09 +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
Dmitry Vyukov
af335eddfe
msan: fix compiler warnings about unused variables
...
llvm-svn: 191821
2013-10-02 14:02:08 +00:00
Evgeniy Stepanov
01781722b6
[sanitizer] Intercept backtrace, backtrace_symbols.
...
llvm-svn: 191516
2013-09-27 12:40:23 +00:00
Evgeniy Stepanov
022235cf04
[msan] Unpoison argument shadow for C++ module destructors.
...
Fixes PR17377.
llvm-svn: 191508
2013-09-27 11:32:21 +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
46901f613b
[msan] Test for atomic handling in MSan.
...
llvm-svn: 191288
2013-09-24 11:21:16 +00:00
Evgeniy Stepanov
ce72b2c20b
[msan] Fix a WTF in r191196.
...
llvm-svn: 191197
2013-09-23 13:34:26 +00:00
Evgeniy Stepanov
f497bfee76
[msan] Allow nested symbolizer and loader scopes.
...
llvm-svn: 191196
2013-09-23 13:26:31 +00:00
Alexey Samsonov
786ee9b1ad
[MSan] Fix -Wempty-body warning
...
llvm-svn: 190994
2013-09-19 08:35:16 +00:00
Evgeniy Stepanov
08d649c024
[msan] Check return value of main: compiler-rt tests.
...
llvm-svn: 190783
2013-09-16 13:25:26 +00:00
Evgeniy Stepanov
65562f5281
[msan] Fix origin of deallocated memory.
...
MSan poisons deallocated memory but it used to give it an invalid origin value,
resulting in confusing reports. This change associates deallocation stack trace
with such memory.
Note that MSan does not have quarantine, and use-after-free detection is very
limited.
llvm-svn: 190781
2013-09-16 11:03:31 +00:00
Evgeniy Stepanov
0da35401ce
[msan] Add source file:line to stack origin reports.
...
Test.
llvm-svn: 190690
2013-09-13 12:55:07 +00:00
Evgeniy Stepanov
ac5ac34cf7
[msan] Add source file:line to stack origin reports.
...
Runtime library part.
llvm-svn: 190686
2013-09-13 12:49:13 +00:00
Evgeniy Stepanov
9be91e970e
[msan] Intercept tzset.
...
llvm-svn: 190682
2013-09-13 11:27:38 +00:00
Alexey Samsonov
7a36e6126b
[Sanitizer] Refactor symbolization interface: use class instead of several functions. Move some code around to get rid of extra source files
...
llvm-svn: 190410
2013-09-10 14:36:16 +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
842fa3f80d
[msan] Intercept fstatat / fstatat64.
...
llvm-svn: 190306
2013-09-09 13:40:41 +00:00
Evgeniy Stepanov
5c1035e7fa
[sanitizer] A bunch of linux system call handlers.
...
llvm-svn: 190157
2013-09-06 14:20:01 +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
Sergey Matveev
b9d34443f2
[lsan] Colorize LSan reports.
...
llvm-svn: 189804
2013-09-03 13:31:03 +00:00
Alexey Samsonov
5b5c99d219
ASan, LSan, MSan: try to find llvm-symbolizer binary in PATH if it is not provided. Now we don't need to explicitly set the location of llvm-symbolizer in lit test configs.
...
llvm-svn: 189801
2013-09-03 13:22:51 +00:00
Evgeniy Stepanov
499d480be5
[msan] Another regression test for r189786.
...
llvm-svn: 189787
2013-09-03 10:08:14 +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
Alexey Samsonov
ef643ce471
[sanitizer] fix code style
...
llvm-svn: 189474
2013-08-28 11:26:09 +00:00
Evgeniy Stepanov
4f961de94e
[msan] Remove extra backup/restore calls.
...
llvm-svn: 189461
2013-08-28 09:17:47 +00:00
Alexey Samsonov
0803953cea
Generate list of symbols exported from sanitizer runtimes only on 64-bit Unix
...
llvm-svn: 189454
2013-08-28 08:07:04 +00:00
Alexey Samsonov
acab30e927
Properly generate lists of exported symbols for sanitizer runtimes
...
This change adds a Python script that is invoked for
the just-built sanitizer runtime to generate the list of exported symbols
passed to the linker. By default, it contains interceptors and sanitizer
interface functions, but can be extended with tool-specific lists.
llvm-svn: 189356
2013-08-27 15:08:02 +00:00
Evgeniy Stepanov
cb22c67a21
[msan] Save/restore va_arg_overflow_tls in signal handlers.
...
llvm-svn: 189351
2013-08-27 14:08:15 +00:00
Evgeniy Stepanov
c41798152f
[msan] Unpoison all TLS shadow when leaving a signal handler.
...
llvm-svn: 189343
2013-08-27 12:59:39 +00:00
Evgeniy Stepanov
bb25af5f7b
[msan] Fix a data race in signal/sigaction interceptors.
...
llvm-svn: 189342
2013-08-27 11:34:05 +00:00
Evgeniy Stepanov
82185980c4
[msan] A test for ppoll() interceptor.
...
llvm-svn: 189339
2013-08-27 11:10:20 +00:00
Evgeniy Stepanov
a40a058ff1
[sanitizer] Simplify sigaction and sigset_t handling.
...
llvm-svn: 189338
2013-08-27 11:10:04 +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
Dmitry Vyukov
97f0eae0a5
tsan/msan: add halt_on_error flag
...
If halt_on_error==true, program terminates after reporting first error.
llvm-svn: 188279
2013-08-13 15:33:00 +00:00
Timur Iskhodzhanov
eee13914e2
Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used
...
llvm-svn: 188261
2013-08-13 11:42:45 +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
Daniel Dunbar
bc5dbc435e
[tests] Update to use lit_config and lit package, as appropriate.
...
llvm-svn: 188116
2013-08-09 22:14:01 +00:00
Evgeniy Stepanov
564215d949
[sanitizer] Intercept scandir/scandir64.
...
llvm-svn: 187982
2013-08-08 13:57:15 +00:00
Evgeniy Stepanov
233455cba8
[sanitizer] Intercept strerror and strerror_r.
...
llvm-svn: 187978
2013-08-08 11:44:05 +00:00
Evgeniy Stepanov
7ea4795ed3
[sanitizer] ASan/MSan tests for r187967.
...
r187967: Disable inlining between sanitized and non-sanitized functions.
llvm-svn: 187971
2013-08-08 09:23:19 +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
1ea380f693
[msan] Fix msan tests with pipefail option.
...
llvm-svn: 187485
2013-07-31 09:14:55 +00:00
Evgeniy Stepanov
9fbd981f99
[sanitizer] read() syscall hook.
...
llvm-svn: 187414
2013-07-30 13:04:43 +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
Peter Collingbourne
9058c07c95
Move UnpoisonMappedDSO to sanitizer_common.
...
This is so DFSan will be able to use it.
Differential Revision: http://llvm-reviews.chandlerc.com/D1206
llvm-svn: 187372
2013-07-29 19:09:49 +00:00
Chandler Carruth
d45abe12a6
Turn off pipefail on msan tests to match the other sanitizers until
...
someone can go through and update the RUN lines appropriately for the
new pipefail behavior.
llvm-svn: 187298
2013-07-27 10:30:39 +00:00
Hans Wennborg
2e304b6ffd
Use --driver-mode=g++ instead of -ccc-cxx; required after Clang r186605
...
llvm-svn: 186607
2013-07-18 20:48:50 +00:00
Alexey Samsonov
9916aa2d95
[Sanitizer] move strcpy and strncpy to common interceptors
...
llvm-svn: 186408
2013-07-16 12:51:53 +00:00
Timur Iskhodzhanov
d7eb67774e
Fix check_lint warnings in sanitizers' runtime libraries
...
llvm-svn: 186328
2013-07-15 16:11:39 +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
7160fb6511
[sanitizer] Update glob64 interceptor to handle GLOB_ALTDIRFUNC as well.
...
llvm-svn: 185935
2013-07-09 12:34:25 +00:00
Evgeniy Stepanov
faba61a7bc
[sanitizer] Support GLOB_ALTDIRFUNC in glob interceptor.
...
llvm-svn: 185932
2013-07-09 12:07:59 +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
f7f252d025
[sanitizer] Syscall handlers for clock_gettime and clock_getres.
...
llvm-svn: 185913
2013-07-09 08:54:59 +00:00
Evgeniy Stepanov
628d727749
[msan] Intercept pthread_key_create.
...
llvm-svn: 185693
2013-07-05 12:31:07 +00:00
Evgeniy Stepanov
717e0cd2a7
[sanitizer] Intercept tcgetattr.
...
llvm-svn: 185626
2013-07-04 14:03:31 +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
69a387e6ae
[sanitizer] Fix GLOB_NOMATCH behaviour and refactor the interceptor a bit.
...
llvm-svn: 185428
2013-07-02 14:08:52 +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
1df4dfe87a
[sanitizer] Intercept setlocale.
...
llvm-svn: 185416
2013-07-02 09:23:45 +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
Alexey Samsonov
e71f37c1cd
Define the path to llvm-symbolizer tool in a common config to reduce copy-paste
...
llvm-svn: 185286
2013-06-30 14:47:38 +00:00
Evgeniy Stepanov
dec0f76c14
[sanitizer] Intercept ptrace.
...
llvm-svn: 185142
2013-06-28 11:02:43 +00:00
Evgeniy Stepanov
f5cae53057
[msan] Optionally disable 2 tests (dlopen & gethostbyname).
...
llvm-svn: 185076
2013-06-27 13:21:00 +00:00
Alexey Samsonov
ed4594b76a
[MSan] Rename __msan_unpoision_param to __msan::UnpoisonParam - it shouldn't be in interface
...
llvm-svn: 185062
2013-06-27 07:50:56 +00:00
Evgeniy Stepanov
06d6c25141
[sanitizer] readdir and readdir_r interceptors.
...
llvm-svn: 184950
2013-06-26 15:00:53 +00:00
Evgeniy Stepanov
982d56abb8
[sanitizer] Move log_path to common flag and use it in MSan.
...
llvm-svn: 184836
2013-06-25 13:50:44 +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
830550ce4c
[msan] Unpoison param-tls in signal handler wrapper.
...
This an entry point from uninstrumented code.
llvm-svn: 184734
2013-06-24 13:48:42 +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
Evgeniy Stepanov
ae4e1ec4e6
[msan] Add keep_going runtime flag.
...
llvm-svn: 184542
2013-06-21 12:37:58 +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
cead69d4a3
[sanitizer] Handle SIOCGIFCONF ioctl.
...
llvm-svn: 183529
2013-06-07 15:49:38 +00:00
Evgeniy Stepanov
0b1f41b6f4
[sanitizer] ioctl interceptor.
...
ASan: disabled by default
MSan: enabled by default
TSan: disabled
llvm-svn: 183517
2013-06-07 13:00:47 +00:00
Alexey Samsonov
f6630ecee9
Simplify lit configs for asan/lsan/msan unit tests
...
llvm-svn: 183410
2013-06-06 13:48:20 +00:00
Alexey Samsonov
e3bf521b7c
Remove a bunch of copy-paste: use common config for sanitizer lit/unit tests
...
llvm-svn: 183407
2013-06-06 13:28:37 +00:00
Evgeniy Stepanov
56050e8f69
[sanitizer] Fix __sanitizer_unaligned_* to work with unaligned data types.
...
llvm-svn: 183224
2013-06-04 13:49:10 +00:00
Evgeniy Stepanov
53c8c13bf1
[msan] Implement __sanitizer_unaligned_*.
...
llvm-svn: 183221
2013-06-04 13:08:36 +00:00
Evgeniy Stepanov
4717d2d494
[msan] Fix gcc build of msan runtime.
...
llvm-svn: 182999
2013-05-31 13:04:07 +00:00
Evgeniy Stepanov
96284becf4
[msan] Handle mixed track-origins and keep-going settings (compiler-rt part).
...
Before this change, each module defined a weak_odr global __msan_track_origins
with a value of 1 if origin tracking is enabled, 0 if disabled. If there are
modules with different values, any of them may win. If 0 wins, and there is at
least one module with 1, the program will most likely crash.
With this change, __msan_track_origins is only emitted if origin tracking is
on. Then runtime library detects if there is at least one module with origin
tracking, and enables runtime support for it.
llvm-svn: 182996
2013-05-31 12:04:08 +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
a4d08c4e87
[sanitizer] Move TSan and MSan recvmsg interceptors to common.
...
llvm-svn: 182843
2013-05-29 11:30:00 +00:00
Evgeniy Stepanov
f28217ad0e
[sanitizer] modf/modff/modfl interceptors.
...
llvm-svn: 182838
2013-05-29 10:03:11 +00:00
Alexey Samsonov
c30e2d6b3a
Make InternalAlloc/InternalFree in sanitizer runtimes libc-free by switching to a custom allocator.
...
llvm-svn: 182836
2013-05-29 09:15:39 +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
40d7ed5d1e
[sanitizer] Improve getaddrinfo interceptor.
...
llvm-svn: 182775
2013-05-28 14:34:37 +00:00
Evgeniy Stepanov
dd0780f81c
[msan] Change report header to be more alike to ASan and TSan.
...
llvm-svn: 182774
2013-05-28 14:27:30 +00:00
Alexey Samsonov
9c2bcf8c15
Improve support for compiler-rt tests in CMake build.
...
Now compiler-rt tests run correctly if compiler-rt is checked out into
arbitrary directory (not necessarily projects/compiler-rt).
Patch by Greg Fitzgerald!
llvm-svn: 182726
2013-05-27 09:35:24 +00:00
Evgeniy Stepanov
a343d1d881
[msan] Fix line >80 chars.
...
llvm-svn: 182578
2013-05-23 11:51:47 +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
bfd2122b20
[msan] getaddrinfo & nested interceptor support.
...
Multiple connected changes:
- Ignore reads from nested interceptors.
- Check shadow on reads from common interceptors.
- getaddrinfo interceptor.
llvm-svn: 182466
2013-05-22 12:50:26 +00:00
Alexey Samsonov
b99085b0b8
[MSan] Add empty default blacklist for MSan
...
llvm-svn: 182382
2013-05-21 13:55:56 +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
Peter Collingbourne
6d4a7d3723
[nolibc] Begin moving sanitizer_common's libc-dependent code to a separate library
...
Introduce a new object library, RTSanitizerCommonLibc, which will contain
the subset of sanitizer_common with libc dependencies. RTSanitizerCommon
contains the remainder of sanitizer_common, and is intended to have no
libc dependencies. Begin moving code to RTSanitizerCommonLibc, starting
with sanitizer_common.cc, whose libc-dependent portion is moved to
sanitizer_common_libcdep.cc, the first member of the new library.
This split affects the CMake build only. The makefile build continues
to produce the full sanitizer_common library.
llvm-svn: 182118
2013-05-17 16:17:19 +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
f1efb256f6
Add sanitizer syscall hooks to the tool's export lists.
...
llvm-svn: 181790
2013-05-14 13:55:21 +00:00
Sergey Matveev
6eff11e714
[msan] Common flags in MSan.
...
llvm-svn: 181194
2013-05-06 13:15:14 +00:00
Evgeniy Stepanov
44b75efab4
[sanitizer] Intercept inet_pton and inet_ntop.
...
llvm-svn: 180107
2013-04-23 14:05:15 +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
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
Evgeniy Stepanov
7332acac4c
[msan] Really disable replacement new and delete.
...
llvm-svn: 179522
2013-04-15 12:41:52 +00:00
Alexey Samsonov
e48866969e
[MSan] Demangle function name in description of stack origin
...
llvm-svn: 179368
2013-04-12 07:27:30 +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
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
Evgeniy Stepanov
460067823b
[sanitizer] Interceptors for wait*.
...
llvm-svn: 179096
2013-04-09 14:34:59 +00:00
Evgeniy Stepanov
69967c2835
[msan] Intercept glob() with tests.
...
llvm-svn: 179091
2013-04-09 11:35:13 +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
Kostya Serebryany
5b4267f7e7
[sanitizer] found a bug by code inspection: CHECK(a=b) instead of CHECK(a==b). Was puzzled why lint did not catch it. Turns out this check was disabled for asan source. fix all cases and enable the check
...
llvm-svn: 178872
2013-04-05 14:40:25 +00:00
Evgeniy Stepanov
e7a7a9b972
[msan] Fix sigaction interceptor.
...
llvm-svn: 178868
2013-04-05 12:58:07 +00:00
Evgeniy Stepanov
c7af878a01
[msan] Conditionally disable new() and delete() wrappers.
...
To be used with static libstdc++.
llvm-svn: 178866
2013-04-05 12:03:47 +00:00
Evgeniy Stepanov
7948c648bf
[msan] A runtime option to disable wrapping of signal handlers.
...
llvm-svn: 178865
2013-04-05 11:59:16 +00:00
Alexey Samsonov
734aab4066
[Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers. This fixes PR15516
...
llvm-svn: 178853
2013-04-05 07:30:29 +00:00
Evgeniy Stepanov
7b0e132551
[sanitizer] Use ucontext_t instead of "struct ucontext".
...
Fixes Mac build.
llvm-svn: 178755
2013-04-04 09:03:56 +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
Kostya Serebryany
c3525ce6ac
[sanitizer] while doing fast unwinding make sure that the frame pointer is aligned; fix lint
...
llvm-svn: 178747
2013-04-04 06:52:40 +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
Alexander Potapenko
f8109dd0f8
[libsanitizer] Unmapping the old cache partially invalidates the memory layout, so add
...
a flag to skip cache update for cases when that's unacceptable (e.g. lsan).
Patch by Sergey Matveev (earthdok@google.com )
llvm-svn: 178000
2013-03-26 10:34:37 +00:00
Richard Smith
c91e327cba
Build and install .syms files alongside sanitizer runtimes. These are used to
...
specify which symbols are exported to DSOs when the sanitizer is statically
linked into a binary.
llvm-svn: 177784
2013-03-23 00:31:07 +00:00
Evgeniy Stepanov
ecbf64648f
[msan] Handle dlopen() failure in dlopen interceptor.
...
llvm-svn: 177728
2013-03-22 11:59:49 +00:00