summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Conditionalise inclusion of link.h on !SANITIZER_ANDROID.Peter Collingbourne2013-08-301-0/+2
| | | | | | | | Hopefully fixes the Android build. Differential Revision: http://llvm-reviews.chandlerc.com/D1551 llvm-svn: 189696
* Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where ↵Timur Iskhodzhanov2013-08-131-1/+1
| | | | | | SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used llvm-svn: 188261
* [sanitizer] Disable ForEachMappedRegion on Android.Evgeniy Stepanov2013-07-301-0/+2
| | | | | | It needs interface that is missing from the NDK, and it is not used on Android anyway. llvm-svn: 187407
* Fix warning.Peter Collingbourne2013-07-291-1/+1
| | | | llvm-svn: 187373
* Move UnpoisonMappedDSO to sanitizer_common.Peter Collingbourne2013-07-291-0/+37
| | | | | | | | This is so DFSan will be able to use it. Differential Revision: http://llvm-reviews.chandlerc.com/D1206 llvm-svn: 187372
* tsan: fix unitialized read warning under newer gcc (it does not have ↵Dmitry Vyukov2013-07-171-1/+1
| | | | | | visibility into asm) llvm-svn: 186495
* [asan] workaround for the quemu bug in proc maps ↵Kostya Serebryany2013-05-301-1/+3
| | | | | | (http://code.google.com/p/address-sanitizer/issues/detail?id=160) llvm-svn: 182922
* [nolibc] Unweak SymbolizerPrepareForSandboxing and move it to ↵Peter Collingbourne2013-05-291-2/+1
| | | | | | | | | | libc-independent part. Fixes the Go build. Differential Revision: http://llvm-reviews.chandlerc.com/D877 llvm-svn: 182851
* [nolibc] Make SymbolizerPrepareForSandboxing weak and optional.Peter Collingbourne2013-05-281-1/+2
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D872 llvm-svn: 182765
* [ASan] Introduce SymbolizerPrepareForSandboxing(), which is a no-op on every ↵Alexander Potapenko2013-05-231-0/+3
| | | | | | | | platform except Linux (because we don't support sandboxing anywhere else yet) On Linux we pre-cache the value of readlink("/proc/self/exe"), so that it can be later used when the sandbox has been turned on. llvm-svn: 182579
* [sanitizer] fix asan on the platforms where the page size is not a ↵Kostya Serebryany2013-05-211-0/+4
| | | | | | compile-time constant (or at least where EXEC_PAGESIZE may not be trustworthy), e.g. powerpc64. llvm-svn: 182351
* [nolibc] Move GetPageSize to the individual platforms.Peter Collingbourne2013-05-201-0/+4
| | | | | | | | | GetPageSize wraps sysconf(_SC_PAGESIZE) on POSIX platforms, but sysconf resides in libc. To make this libc-independent on Linux, move the wrapper to sanitizer_mac.cc and return the Linux-specific constant EXEC_PAGESIZE in the sanitizer_linux.cc implementation. llvm-svn: 182303
* [nolibc] Move libc-dependent sanitizer_linux.cc code to ↵Peter Collingbourne2013-05-201-242/+1
| | | | | | sanitizer_linux_libcdep.cc. llvm-svn: 182292
* [nolibc] Make GetArgsAndEnv libc-independent.Peter Collingbourne2013-05-201-18/+18
| | | | | | | __libc_stack_end is made into a weak symbol if possible. If libc is not linked, read args and environment from /proc. llvm-svn: 182276
* [sanitizer] LibraryNameIs in sanitizer_linuxSergey Matveev2013-05-141-0/+12
| | | | llvm-svn: 181787
* [nolibc] Change internal syscall API to remove reliance on libc's errno.Peter Collingbourne2013-05-081-54/+72
| | | | | | | | | | | | | This change moves to a model where the error value of a system call is potentially contained in the return value itself rather than being implicit in errno. The helper function internal_iserror can be used to extract the error value from a return value. On platforms other than Linux/x86_64 this still uses errno, but other platforms are free to port their error handling to this new model. Differential Revision: http://llvm-reviews.chandlerc.com/D756 llvm-svn: 181436
* [sanitizer] Fixed InitTlsSize for Android.Sergey Matveev2013-05-071-1/+1
| | | | llvm-svn: 181330
* [sanitizer] Fixed includes in sanitizer_linux.cc for Android.Sergey Matveev2013-05-071-0/+4
| | | | llvm-svn: 181327
* [sanitizer] Move GetThreadStackAndTls from TSan to sanitizer_common.Sergey Matveev2013-05-071-0/+47
| | | | | | | | Move this function to sanitizer_common because LSan uses it too. Also, fix a bug where the TLS range reported for main thread was off by the size of the thread descriptor from libc (TSan doesn't care much, but for LSan it's critical). llvm-svn: 181322
* [sanitizer] Sanitizer __internal_*stat interface.Evgeniy Stepanov2013-05-071-14/+33
| | | | | | | | | With this change, __internal_*stat always expect a "struct stat *" argument. This avoids stat/stat64 caller-side confusion (sanitizer_common tests already made this mistake), and allows the use of __internal_fstat() as a drop-in replacement for libc's fstat(). llvm-svn: 181311
* Revert r180599 "[sanitizer] Clear LD_PRELOAD when forking an external ↵Sergey Matveev2013-04-261-14/+0
| | | | | | symbolizer." llvm-svn: 180602
* [sanitizer] Clear LD_PRELOAD when forking an external symbolizer.Sergey Matveev2013-04-261-0/+14
| | | | llvm-svn: 180599
* Revert r180082 and add a test for SetEnv functionAlexey Samsonov2013-04-231-0/+14
| | | | llvm-svn: 180098
* [Sanitizer] Delete unused functionAlexey Samsonov2013-04-231-14/+0
| | | | llvm-svn: 180082
* Remove InternalAlloc/InternalFree calls from StopTheWorld. Patch by Sergey ↵Alexey Samsonov2013-04-051-4/+5
| | | | | | Matveev. llvm-svn: 178855
* [Sanitizer] Kill the remainders of platform defines in favor of SANITIZER_ ↵Alexey Samsonov2013-04-031-1/+1
| | | | | | defines llvm-svn: 178627
* [libsanitizer] Unmapping the old cache partially invalidates the memory ↵Alexander Potapenko2013-03-261-8/+11
| | | | | | | | | | 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
* tsan: add SetEnv() function that can be used in frontendsDmitry Vyukov2013-03-251-0/+14
| | | | llvm-svn: 177857
* tsan: use a single background thread for memory profiler and memory flush ↵Dmitry Vyukov2013-03-211-0/+12
| | | | | | (and later for symbolizer flush) llvm-svn: 177627
* tsan: add internal_unlink() functionDmitry Vyukov2013-03-201-0/+4
| | | | llvm-svn: 177510
* [sanitizer] Replace more platform checks with SANITIZER_ constants.Evgeniy Stepanov2013-03-191-2/+4
| | | | llvm-svn: 177400
* [sanitizer] Avoid use of uintptr_t.Evgeniy Stepanov2013-03-191-1/+1
| | | | llvm-svn: 177384
* [sanitizer] Don't adjust the size of the user-allocated stack.Evgeniy Stepanov2013-03-191-0/+24
| | | | | | Moved this code to sanitizer_common. llvm-svn: 177383
* [Sanitizer] Add default constructor for BlockingMutexAlexey Samsonov2013-03-141-0/+4
| | | | llvm-svn: 177072
* [sanitizer] Move GetTlsSize code from TSan to sanitizer_common.Evgeniy Stepanov2013-03-131-0/+29
| | | | llvm-svn: 176938
* [Sanitizer] Fix a typo in function nameAlexey Samsonov2013-03-131-5/+5
| | | | llvm-svn: 176932
* [Sanitizer] Change MemoryMappingLayout methods to also report memory ↵Alexey Samsonov2013-03-131-8/+23
| | | | | | protection flags (for future use in leak checker). Patch by Sergey Matveev. llvm-svn: 176931
* [Sanitizer] Implement BlockingMutex::CheckLocked()Alexey Samsonov2013-03-111-0/+5
| | | | llvm-svn: 176805
* [Sanitizer] don't include missing header on AndroidAlexey Samsonov2013-02-271-2/+5
| | | | llvm-svn: 176183
* add Linux syscall wrappers and ThreadLister to sanitizer_commonKostya Serebryany2013-02-271-0/+111
| | | | | | | | ThreadLister is a Linux-specific class for obtaining the thread IDs of a process from procfs (/proc/<pid>/task/). It will be used by leak checking code. Also add several syscall wrappers which will be required by the same code that uses ThreadLister, but are not used in ThreadLister itself. Patch by Sergey Matveev llvm-svn: 176179
* [Sanitizer] use raw syscall instead of _exit() function on LinuxAlexey Samsonov2013-02-201-0/+5
| | | | llvm-svn: 175622
* [msan] Fix ReExec on linux.Evgeniy Stepanov2013-02-191-1/+3
| | | | | | | execle(argv[0], ...) is wrong, because argv[0] may contain a PATH-resolvable program name. Execute /proc/self/exe instead. llvm-svn: 175504
* [sanitizer] Get full argv and envp on glibc.Evgeniy Stepanov2013-02-141-3/+24
| | | | | | | /proc/$PID/cmdline is clipped to 4Kb. Locate argv and envp on the main thread stack. llvm-svn: 175163
* [sanitizer] Raise argv limit for ReExec.Evgeniy Stepanov2013-02-141-1/+1
| | | | | | We are still limited by /proc/*/cmdline size (4Kb max on Linux!). llvm-svn: 175145
* [Sanitizer] extend internal libc with stat/fstat/lstat functionsAlexey Samsonov2013-02-041-4/+26
| | | | llvm-svn: 174316
* [Sanitizer] use u32 instead of mode_t, which is defined in Darwin headersAlexey Samsonov2013-02-011-1/+1
| | | | llvm-svn: 174189
* [Sanitizer] make internal_open have the same interface as libc versionAlexey Samsonov2013-02-011-2/+10
| | | | llvm-svn: 174187
* asan/tsan: manually define FUTEX constants, because <linux/futes.h> header ↵Dmitry Vyukov2013-01-301-2/+5
| | | | | | is broken on some linux distributions llvm-svn: 173933
* Have ReExec read environment from /proc/self/environPeter Collingbourne2013-01-171-13/+20
| | | | | | | | | | It is possible for ReExec to be called before the C standard library has initialised itself sufficiently for execv to work properly. Fix this by parsing the environment ourselves and using execve. Differential Revision: http://llvm-reviews.chandlerc.com/D304 llvm-svn: 172748
* [sanitizer] hide PR_SET_NAME under an ifdef (for older kernels)Kostya Serebryany2013-01-151-0/+8
| | | | llvm-svn: 172523
OpenPOWER on IntegriCloud