Commit Graph

32 Commits

Author SHA1 Message Date
Evgeniy Stepanov 41060fd728 [sanitizer] Fix Android build.
llvm-svn: 184293
2013-06-19 10:36:31 +00:00
Evgeniy Stepanov f9cfe76526 [sanitizer] Fix build on RHEL 6.3, 6.4.
linux/if_ppp.h is broken in certain kernels.

llvm-svn: 184290
2013-06-19 08:55:28 +00:00
Evgeniy Stepanov 394b09b00f [sanitizer] Fix Android build.
llvm-svn: 184187
2013-06-18 13:56:12 +00:00
Evgeniy Stepanov fc3f61fcf0 [sanitizer] Remove a set of deprecated ioctls.
llvm-svn: 184185
2013-06-18 10:37:17 +00:00
Evgeniy Stepanov b9c1020696 [sanitizer] Replace ext2_ ioctls with generic fs_ ioctls.
They are actually the same, but ext2_fs.h header is not available in userspace
with newer kernels.

llvm-svn: 184184
2013-06-18 09:49:04 +00:00
Evgeniy Stepanov 8fa046e288 [sanitizer] Symbolic ioctl names.
Replace hardcoded ioctl request ids with symbolic names.
Disable certain ioctls on platforms where such names are not found in the
system headers.
Fix a bug in ioctl_lookup.
Reenable ioctl test on Mac.

llvm-svn: 184183
2013-06-18 09:22:24 +00:00
Dmitry Vyukov 50ef53ebfc tsan: fix lint warnings
llvm-svn: 183642
2013-06-10 10:00:54 +00:00
Bill Wendling 658fb53b7e Reverting r183529:
This is causing the following error on Darwin:

/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:282:1: error: 'assertion_failed__282' declared as an array with a negative size
CHECK_TYPE_SIZE(ifconf);
^~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:223:3: note: expanded from macro 'CHECK_TYPE_SIZE'
  COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:284:1: error: 'assertion_failed__284' declared as an array with a negative size
CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:228:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
  COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) ==          \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~

llvm-svn: 183557
2013-06-07 20:28:29 +00:00
Evgeniy Stepanov cead69d4a3 [sanitizer] Handle SIOCGIFCONF ioctl.
llvm-svn: 183529
2013-06-07 15:49:38 +00:00
Evgeniy Stepanov c24e13e7bb [sanitizer] Fix Android build.
llvm-svn: 183523
2013-06-07 14:56:54 +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
Evgeniy Stepanov 1cf5ef5018 [sanitizer] Fix wrong size of addrinfo::ai_addrlen.
Add compile time tests for sizes and offsets of all sanitizer-posix types.

llvm-svn: 182993
2013-05-31 10:46:51 +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 a4d08c4e87 [sanitizer] Move TSan and MSan recvmsg interceptors to common.
llvm-svn: 182843
2013-05-29 11:30:00 +00:00
Evgeniy Stepanov ab25369d04 [sanitizer] Interceptors for gethostbyname and friends.
llvm-svn: 182573
2013-05-23 11:10:23 +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
Evgeniy Stepanov 44ff0eb4b9 [sanitizer] Fix gcc build.
llvm-svn: 182094
2013-05-17 13:30:48 +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 44b75efab4 [sanitizer] Intercept inet_pton and inet_ntop.
llvm-svn: 180107
2013-04-23 14:05:15 +00:00
Evgeniy Stepanov 3076ba0a08 [sanitizer] Intercept getgrnam{_r}, getgrgid{_r}.
llvm-svn: 180091
2013-04-23 12:01:20 +00:00
Evgeniy Stepanov 460067823b [sanitizer] Interceptors for wait*.
llvm-svn: 179096
2013-04-09 14:34:59 +00:00
Evgeniy Stepanov 24b2169e07 [sanitizer] Android lacks ucontext_t definition.
llvm-svn: 178756
2013-04-04 09:21:48 +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
Alexey Samsonov a0e28a7aaa [Sanitizer] Kill the remainders of platform defines in favor of SANITIZER_ defines
llvm-svn: 178627
2013-04-03 07:24:35 +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 0af672326a [sanitizer] Replace more platform checks with SANITIZER_ constants.
llvm-svn: 177400
2013-03-19 14:33:38 +00:00
Evgeniy Stepanov 8d487b4407 [sanitizer] No dirent64 on Android.
llvm-svn: 177071
2013-03-14 13:24:03 +00:00
Evgeniy Stepanov 740e6ebe71 [msan] Add changes missing from r177065.
llvm-svn: 177067
2013-03-14 13:13:49 +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
Evgeniy Stepanov 3e2e32c618 [sanitizer] Fix Android build.
llvm-svn: 175503
2013-02-19 11:06:41 +00:00
Evgeniy Stepanov ea61d08185 [sanitizer] Add interceptors for localtime and friends.
llvm-svn: 175499
2013-02-19 09:19:16 +00:00