summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_platform_limits_posix.h
AgeCommit message (Collapse)Author
2016-04-26[sanitizer] [SystemZ] Add ptrace support bits.Marcin Koscielnicki
Differential Revision: http://reviews.llvm.org/D19134 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14[sanitizer] [SystemZ] Add/fix kernel and libc type definitions.Marcin Koscielnicki
This is the first part of upcoming asan support for s390 and s390x. Note that there are bits for 31-bit support in this and subsequent patches - while LLVM itself doesn't support it, gcc should be able to make use of it just fine. Differential Revision: http://reviews.llvm.org/D18888 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16[ASAN] Add support for mips/mips64 androidMohit K. Bhakkad
Patch by Duane Sand Reviewers: samsonov Subscribers: duanesand, jaydeep, sagar, llvm-commits, filcab. Differential Revision: http://reviews.llvm.org/D17883 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263621 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26[compiler-rt] Enable ptrace sanitizer for armAdhemerval Zanella
This patch enables the ptrace syscall interceptors for arm and adds support for both PTRACE_GETVFPREGS and PTRACE_SETVFPREGS used to get the VFP register from ARM. The ptrace tests is also updated with arm and PTRACE_GETVFPREGS tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-12[asan] Zero initialize sem_t in sem_init.Evgeniy Stepanov
Old version of sem_init (GLIBC_2.0) fails to initialize parts of sem_t that are used in sem_timedwait. This is fixed in GLIBC_2.1, but since ASan interceptors downgrade sem_* to the oldest available version, this can introduce bugs that are only present in sanitized build. Workaround by zero-initializing sem_t in sem_init. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-16[MSan] Enable MSAN for aarch64Adhemerval Zanella
This patch enabled msan for aarch64 with 39-bit VMA and 42-bit VMA. As defined by lib/msan/msan.h the memory layout used is for 39-bit is: 00 0000 0000 - 40 0000 0000: invalid 40 0000 0000 - 43 0000 0000: shadow 43 0000 0000 - 46 0000 0000: origin 46 0000 0000 - 55 0000 0000: invalid 55 0000 0000 - 56 0000 0000: app (low) 56 0000 0000 - 70 0000 0000: invalid 70 0000 0000 - 80 0000 0000: app (high) And for 42-bit VMA: 000 0000 0000 - 100 0000 0000: invalid 100 0000 0000 - 11b 0000 0000: shadow 11b 0000 0000 - 120 0000 0000: invalid 120 0000 0000 - 13b 0000 0000: origin 13b 0000 0000 - 2aa 0000 0000: invalid 2aa 0000 0000 - 2ab 0000 0000: app (low) 2ab 0000 0000 - 3f0 0000 0000: invalid 3f0 0000 0000 - 400 0000 0000: app (high) Most of tests are passing with exception of: * Linux/mallinfo.cc * chained_origin_limits.cc * dlerror.cc * param_tls_limit.cc * signal_stress_test.cc * nonnull-arg.cpp The 'Linux/mallinfo.cc' is due the fact AArch64 returns the sret in 'x8' instead of default first argument 'x1'. So a function prototype that aims to mimic (by using first argument as the return of function) won't work. For GCC one can make a register alias (register var asm ("r8")), but for clang it detects is an unused variable and generate wrong code. The 'chained_origin_limits' is probably due a wrong code generation, since it fails only when origin memory is used (-fsanitize-memory-track-origins=2) and only in the returned code (return buf[50]). The 'signal_streess_test' and 'nonnull-arg' are due currently missing variadic argument handling in memory sanitizer code instrumentation on LLVM side. Both 'dlerror' and 'param_tls_test' are unknown failures that require further investigation. All the failures are XFAIL for aarch64 for now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247809 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08[msan] Unpoison dlpi_phdr in dl_iterate_phdr.Evgeniy Stepanov
In some cases, PHDR table is allocated with malloc() by the linker instead of being mapped from file. It needs to be unpoisoned in the dl_iterate_phdr callback then. This happens when program headers are not part of any loadable ELF segment. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247100 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25[msan] Teach sanitizers about the PPC64 ptrace syscallJay Foad
Summary: This fixes test/msan/Linux/syscalls.cc, and should also fix the ppc64 sanitizer buildbots which are currently failing in "make check-sanitizer". Reviewers: samsonov, wschmidt, eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10734 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23Working on reconciling out-of-tree patches to compiler-rt for building for iOS.Chris Bieneman
Summary: This is one of many changes needed for compiler-rt to get it building on iOS. This change ifdefs out headers and functionality that aren't available on iOS. Note: this change does not enable building for iOS, as there are more changes to come. Reviewers: glider, kubabrecka, bogner, samsonov Reviewed By: samsonov Subscribers: samsonov, llvm-commits Differential Revision: http://reviews.llvm.org/D10514 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19[msan] Intercept fopencookie.Evgeniy Stepanov
https://code.google.com/p/memory-sanitizer/issues/detail?id=86 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240107 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-27[asan] Fix ASan build on Android/AArch64.Evgeniy Stepanov
The build for aarch64 is not enabled in cmake/config-ix.cmake yet. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@235944 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19[LSan] [MIPS] adding support of LSan for mips64/mips64el archMohit K. Bhakkad
Patch by Sagar Thakur Reviewers: petarj, earthdok, kcc. Subscribers: samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits. Differential Revision: http://reviews.llvm.org/D7013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18[MSan][MIPS] Fix for some failing tests on MIPS64Mohit K. Bhakkad
Enabling internal ptrace for mips, which fixes some ptrace related tests. Along with this fixing some other failures. Reviewers: Reviewers: eugenis, kcc, samsonov Subscribers: dsanders, sagar, lldb-commits Differential Revision: http://reviews.llvm.org/D7332 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30[Sanitizers] Introduce GET_LINK_MAP_BY_DLOPEN_HANDLE() macroViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7233 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227570 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-21[sanitizer] Fix aarch64 sanitizer build with recent glibcKostya Serebryany
glibc recently changed ABI on aarch64-linux: https://sourceware.org/git/?p=glibc.git;a=commit;h=5c40c3bab2fddaca8cfe12d75944d1fef8adf1a4 Instead of having unsigned short mode; unsigned short __pad1; it now has unsigned int mode; field in ipc_perm structure. This patch allows to build against the recent glibc and disables the ipc_perm.mode verification for older versions of glibc. I think it shouldn't be a big deal even for older glibcs, I couldn't find any place which would actually care about the exact mode field, rather than the whole structure, appart from the CHECK_SIZE_AND_OFFSET macro. Patch by Jakub Jelinek git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226637 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-29[sanitizer] Android build cleanup.Evgeniy Stepanov
* Detect Android toolchain target arch and set correct runtime library name. * Merged a lot of Android and non-Android code paths. * Android is only supported in standalone build of compiler-rt now. * Linking lsan-common in ASan-Android (makes lsan annotations work). * Relying on -fsanitize=address linker flag when building tests (again, unification with non-Android path). * Runtime library moved from lib/asan to lib/linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-16[sanitizer] Fix global constructor warning in sanitizer; patch by Samuel F ↵Kostya Serebryany
Antao git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217904 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-03[asan] i686-linux-android support.Evgeniy Stepanov
Large part of this change is required due to https://code.google.com/p/android/issues/detail?id=61799 dlsym() crashes when symbol resolution fails, which means we have to limit the interceptor list instead of relying on runtime detection. There are minor differencies in system headers, too. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212273 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-24[asan] adding support of 32-bit address sanitizer for MIPSDaniel Sanders
Summary: The patch supports both the clang cross-compiler and native compiler Patch by Kumar Sukhani <Kumar.Sukhani@imgtec.com> Test Plan: Kumar had the following asan test results when compiled on a MIPS board: Expected Passes : 96 Expected Failures : 2 Unsupported Tests : 84 Unexpected Passes : 4 Unexpected Failures: 19 The list of unexpected failures can be found in the review. Reviewers: kcc, petarj, dsanders Reviewed By: kcc Subscribers: farazs, kcc, llvm-commits Differential Revision: http://reviews.llvm.org/D4208 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19[sanitizer] Intercept pthread_*attr_get*.Evgeniy Stepanov
This is a resubmit of r211166 reverted due to osx breakage. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211264 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-18Revert "[sanitizer] Intercept pthread_*attr_get*."Arnold Schwaighofer
This reverts commit r211166. It broke public mac os x bots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211206 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-18[sanitizer] Intercept pthread_*attr_get*.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211166 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-16[sanitizer] Support PTRACE_GETEVENTMSG in the ptrace() interceptor.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211022 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15[sanitizer] Remove the definition of xdr_ops.Evgeniy Stepanov
User-visible instances of xdr_ops always seem to be allocated statically, and don't need unpoisoning. Also, it's size differs between platforms. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208851 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-13[msan] Better open_memstream support.Evgeniy Stepanov
Move fflush and fclose interceptors to sanitizer_common. Use a metadata map to keep information about the external locations that must be updated when the file is written to. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208676 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-13[sanitizer] fix for ARM Linux, patch by Maxim OstapenkoKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208673 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-13[sanitizer] define __sanitizer_time_tKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208671 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-07[sanitizer] Intercept obstack.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208196 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25[sanitizer] Intercept a bunch of stdio calls.Evgeniy Stepanov
Add move fopen/freopen interceptors from TSan to common. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207224 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-04[sanitizer] Intercept a subset of sunrpc interface (xdr_*).Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205627 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01Fix definition of the __sanitizer_passwd structure on FreeBSDViktor Kutuzov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205290 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28[sanitizer] Fix Mac build.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205006 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28[sanitizer] Intercept fgetpwent / fgetgrent.Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205004 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28[sanitizer] Intercept ftime.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204991 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27[sanitizer] Fix Android build.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204927 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27[msan] Intercept several malloc-related functions.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204923 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04A set of trivial changes to support sanitizers on FreeBSD.Alexey Samsonov
Patch by Viktor Kutuzov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202801 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27[ASan] Make sure IOC_DIRMASK is undefined before redefining it.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202410 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27[sanitizer] Sizes and layouts for sanitizers on FreeBSD.Evgeniy Stepanov
Patch by Viktor Kutuzov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202364 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19[asan] A different way of detectinb stack overflow.Evgeniy Stepanov
Instead of checking stack limits that are not well defined for the main thread, we rely on siginfo::si_code and distance from SP. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201673 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13[sanitizer] AArch64 sanitizer support; patch by Christophe Lyon and Yvan RouxKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201303 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-10[msan] Return EINVAL instead of crashing from mmap of an invalid address.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201074 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-10[sanitizer] struct ustat and a bunch of other definitions are missing on ↵Evgeniy Stepanov
Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201068 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-06[sanitizer] Fix build.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200942 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-06[sanitizer] One does not simply intercept getifaddrs().Sergey Matveev
Upgrade the interceptor, and attempt to fix the Android build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200936 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-06[sanitizer] Intercept getifaddrs().Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200926 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-06[sanitizer] Intercept getresuid and getresgid.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200925 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-05[sanitizer] Implement ioctl decoding.Sergey Matveev
When an unknown ioctl is encountered, try to guess the parameter size from the request id. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200872 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31[sanitizer] Partial revert of recent ioctl changes.Sergey Matveev
Some build environments are missing the required headers. This reverts r200544, r200547, r200551. This does not revert the change that introduced READWRITE ioctl type. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200567 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31[asan] Fix Android build.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200551 91177308-0d34-0410-b5e6-96231b3b80d8