summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement AddressSanitizer suppressions.Kuba Brecka2014-12-055-74/+267
| | | | | | | | Adds 3 new suppression types, "interceptor_name", "interceptor_via_fun", "interceptor_via_lib". Reviewed at http://reviews.llvm.org/D6280. llvm-svn: 223508
* [ASan] Refactor thread starting code.Sergey Matveev2014-12-055-24/+23
| | | | | | Move thread context creation into AsanThread::Create(). llvm-svn: 223483
* [ASan] Fix Win build following r223419.Sergey Matveev2014-12-051-6/+18
| | | | llvm-svn: 223477
* [ASan, LSan] Improve tracking of thread creation.Sergey Matveev2014-12-054-13/+43
| | | | | | | | | | | | | | | In the current scheme of things, the call to ThreadStart() in the child thread is not synchronized with the parent thread. So, if a pointer is passed to pthread_create, there may be a window of time during which this pointer will not be discoverable by LSan. I.e. the pthread_create interceptor has already returneed and thus the pointer is no longer on the parent stack, but we don't yet know the location of the child stack. This has caused bogus leak reports (see http://llvm.org/bugs/show_bug.cgi?id=21621/). This patch makes the pthread_create interceptor wait until the child thread is properly registered before returning. llvm-svn: 223419
* ASan CMakeLists.txt: fix bad indent; NFCHans Wennborg2014-12-031-2/+2
| | | | llvm-svn: 223258
* Replace InternalScopedBuffer<char> with InternalScopedString where applicable.Alexey Samsonov2014-12-021-2/+2
| | | | | | | | | | | | | | | | Summary: No functionality change. Test Plan: make check-all Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6472 llvm-svn: 223164
* [asan] Remove the local copy of Android ucontext.h.Evgeniy Stepanov2014-11-281-4/+0
| | | | | | This header is present in the r10c release of the NDK. llvm-svn: 222915
* [Asan] Pack signal context into a structureViktor Kutuzov2014-11-256-31/+60
| | | | | | Differential Revision: http://reviews.llvm.org/D6148 llvm-svn: 222756
* [asan] Improvements for asan deactivated mode: disable asan activation for ↵Yury Gribov2014-11-252-5/+18
| | | | | | | | runtime library on Linux, disable malloc checks. Reviewed in http://reviews.llvm.org/D6265 llvm-svn: 222732
* [ASan] Get fake stack code working with GCC 4.8.2.Jay Foad2014-11-211-1/+3
| | | | | | | | | | | | | | | | | | | | | Summary: TestCases/Linux/heavy_uar_test.cc was failing on my PowerPC64 box with GCC 4.8.2, because the compiler recognised a memset-like loop and turned it into a call to memset, which got intercepted by __asan_memset, which got upset because it was being called on an address in high shadow memory. Use break_optimization to stop the compiler from doing this. Reviewers: kcc, samsonov Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6266 llvm-svn: 222572
* [ASan] Allow the users of SymbolizationLoop to make use of the --dsym_hint ↵Alexander Potapenko2014-11-211-11/+39
| | | | | | | | | | option in llvm-symbolizer Let the users of SymbolizationLoop define a function that produces the list of .dSYM hints (possible path to the .dSYM bundle) for the given binary. Because the hints can't be added to an existing llvm-symbolizer process, we spawn a new symbolizer process ones each time a new hint appears. Those can only appear for binaries that we haven't seen before. llvm-svn: 222535
* [asan] Runtime support for asan-instrument-allocas which enables ↵Yury Gribov2014-11-212-0/+10
| | | | | | | | instrumentation of variable-sized dynamic allocas. Patch by Max Ostapenko. Reviewed at http://reviews.llvm.org/D6055 llvm-svn: 222520
* Make the ASan OS X DYLD_INSERT_LIBRARIES detection path-independentKuba Brecka2014-11-191-1/+1
| | | | | | | | | | Reviewed at http://reviews.llvm.org/D6238 ASan on Darwin during launch reads DYLD_INSERT_LIBRARIES env. variable and if it's not set or if the ASan dylib is not present in there, it relaunches the process. The check whether the dylib is present in the variable is now trying to find a full path in there. This fails in the scenarios where we want to copy the dylib to the executable's directory or somewhere else and set the DYLD_INSERT_LIBRARIES manually, see http://reviews.llvm.org/D6018. Let's change the search in DYLD_INSERT_LIBRARIES to only look for the filename of the dylib and not the full path. llvm-svn: 222297
* [msan] Remove MSanDR and supporting code.Evgeniy Stepanov2014-11-184-4/+4
| | | | | | | | | | 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
* As a follow up to r222001, Peter Bergner pointed out that there isJay Foad2014-11-151-2/+2
| | | | | | nothing 64-bit-specific about the PowerPC stack overflow detection. llvm-svn: 222084
* [ASan] Improved stack overflow detection for PowerPC64Jay Foad2014-11-141-2/+28
| | | | | | | | | | | | | | | | | | | | | Summary: AsanOnSIGSEGV has some heuristics for detecting stack overflow, but they don't cope with a PowerPC store-with-update instruction which modifies sp and stores to the modified address in one instruction. This patch adds some PowerPC-specific code to check for this case. This fixes the last few cases of the stack-overflow test. Reviewers: kcc, samsonov, eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6253 llvm-svn: 222001
* [asan] Revert r221882.Evgeniy Stepanov2014-11-141-1/+3
| | | | | | | This code is not part of ASan runtime (as it may be linked into a different DSO), and thus can not call non-exported functions. llvm-svn: 221986
* Fix -Wcast-qual warnings in sanitizersAlexey Samsonov2014-11-131-3/+3
| | | | llvm-svn: 221936
* [CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC ↵Alexey Samsonov2014-11-131-1/+1
| | | | | | occasionally silently discards unknown -Wno-foo flags. llvm-svn: 221925
* Removed r221896, it seems to break build in various ways.Yury Gribov2014-11-131-1/+1
| | | | llvm-svn: 221912
* [ASan] Add process basename to log name and error message to simplify ↵Yury Gribov2014-11-131-1/+1
| | | | | | | | analysis of sanitized systems logs. Reviewed at http://reviews.llvm.org/D5724 llvm-svn: 221896
* [asan] Switch to AsanInitFromRtl in .preinit_array.Evgeniy Stepanov2014-11-131-1/+3
| | | | | | There is no functionality change due to a check in AsanActivate. llvm-svn: 221882
* [asan] [mips] added support of asan for mips64/mips64el, patch by Kumar SukhaniKostya Serebryany2014-11-121-0/+3
| | | | llvm-svn: 221800
* delete => delete[] for arrays.Richard Trieu2014-11-121-1/+1
| | | | llvm-svn: 221769
* [ASan] Fix use of -asan-instrument-assembly in testsJay Foad2014-11-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The option -asan-instrument-assembly is declared in the X86 backend. If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=All then the option is tolerated but ignored. If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=PowerPC then the testsuite fails with: [ 93%] Generating ASAN_INST_TEST_OBJECTS.gtest-all.cc.powerpc64-inline.o clang (LLVM option parsing): Unknown command line argument '-asan-instrument-assembly'. Try: 'clang (LLVM option parsing) -help' Fix this inconsistency by only adding the option if that toolchain was built with the X86 backend included. Reviewers: kcc, samsonov, eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6190 llvm-svn: 221687
* [Sanitizers] Enable stack traces on FreeBSDViktor Kutuzov2014-11-103-0/+24
| | | | | | Differential Revision: http://reviews.llvm.org/D6086 llvm-svn: 221595
* [ASan] Fix stack-overflow test for PowerPCJay Foad2014-11-081-3/+3
| | | | | | | | | | | | | | | | | Summary: Tweak the asan stack overflow heuristics to cope with PowerPC64 redzones, which are larger than on x86-64: 288 bytes for big-endian and 512 bytes for little-endian. Reviewers: kcc, willschm, samsonov, eugenis Reviewed By: samsonov, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6168 llvm-svn: 221578
* Use GET_CURRENT_FRAME() to calculate the memory layout for power. This worksWill Schmidt2014-11-061-4/+0
| | | | | | | | | | | | | for both PPC64 Big and Little endian modes, so also eliminates the need for the BIG_ENDIAN/LITTLE_ENDIAN #ifdeffery. By trial and error, it also looks like the kPPC64_ShadowOffset64 value is valid using (1ULL << 41) for both BE and LE, so that #if/#elif/#endif block has also been simplified. Differential Revision: http://reviews.llvm.org/D6044 llvm-svn: 221457
* [asan] [mips] changed ShadowOffset32 for systems having 16kb PageSize; patch ↵Kostya Serebryany2014-11-041-6/+6
| | | | | | by Kumar Sukhani llvm-svn: 221288
* Use @rpath as LC_ID_DYLIB for ASan dylib on OS XKuba Brecka2014-11-041-7/+0
| | | | | | | | Change the LC_ID_DYLIB of ASan's dynamic libraries on OS X to be set to "@rpath/libclang_rt.asan_osx_dynamic.dylib" and similarly for iossim. Clang driver then sets the "-rpath" to be the real path to where clang currently has the dylib (because clang uses the relative path to its current executable). This means if you move the compiler or install the binary release, -fsanitize=address will link to the proper library. Reviewed at http://reviews.llvm.org/D6018 llvm-svn: 221278
* Unbreak the darwin build.Adrian Prantl2014-10-271-1/+1
| | | | | | Patch by Ismail Pazarbasi! llvm-svn: 220683
* Change StackDepot interface to use StackTrace more extensivelyAlexey Samsonov2014-10-263-4/+4
| | | | llvm-svn: 220637
* [Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov2014-10-267-119/+118
| | | | | | | | | | | | | | | | | | | | | | introduce a BufferedStackTrace class, which owns this array. Summary: This change splits __sanitizer::StackTrace class into a lightweight __sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace, which owns it. This would allow us to simplify the interface of StackDepot, and eventually merge __sanitizer::StackTrace with __tsan::StackTrace. Test Plan: regression test suite. Reviewers: kcc, dvyukov Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5985 llvm-svn: 220635
* Appeasing an MSVC compile warning about "and"; NFC.Aaron Ballman2014-10-231-1/+1
| | | | llvm-svn: 220519
* Fix checks for Android.Dan Albert2014-10-201-4/+4
| | | | | | | | | | | | __ANDROID__ is a define that comes from the toolchain when building for Android targets. ANDROID has a different meaning. ANDROID is defined for _every_ Android build, including those done for host modules. For host modules, we want to build the regular Linux sanitizers and builtins, not the one for Android devices. This hasn't been a problem until now because we only just started building the sanitizers for the host. llvm-svn: 220203
* [asan] the run-time part of intra-object-overflow detector ↵Kostya Serebryany2014-10-174-0/+44
| | | | | | (-fsanitize-address-field-padding=1). Note that all of this is still experimental; don't use unless you are brave. llvm-svn: 220013
* [compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, ↵Kuba Brecka2014-10-152-17/+17
| | | | | | | | | | 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
* [compiler-rt] Enable ASAN for powerpc64le-linuxWill Schmidt2014-10-152-2/+6
| | | | | | | | | | | | | | | | | | Whitespace update for lint check by myself (Will). Otherwise code and comments by Peter Bergner, as previously seen on llvm-commits. The following patch gets ASAN somewhat working on powerpc64le-linux. It currently assumes the LE kernel uses 46-bit addressing, which is true, but it doesn't solve the case for BE where it may be 44 or 46 bits. That can be fixed with a follow on patch. There are some test suite fails even with this patch that I haven't had time to solve yet, but this is better than the state it is in now. The limited debugging of those test suite fails seems to show that the address map for 46-bit addressing has changed and so we'll need to modify the shadow memory location slightly. Again, that can be fixed with a follow on patch. llvm-svn: 219827
* Fix silly commit to disable test on ARMRenato Golin2014-10-141-1/+1
| | | | llvm-svn: 219681
* Disable failing ASAN LongJump test on ARMRenato Golin2014-10-141-3/+3
| | | | | | | Updated the URL to reflect information on the problem as well as build the case for ARM. This seems to be a wider problem, not ARM or PPC specific. llvm-svn: 219680
* [asan] Add fast_unwind_on_check flag.Evgeniy Stepanov2014-10-142-1/+10
| | | | | | | | | Allows to specify the unwinder to use for CHECK failures. Previous behaviour was to use the "fatal" unwinder. As compiler-rt is built without frame pointers, only the slow unwinder really makes sense here, and it is the default. llvm-svn: 219677
* [asan] Minor tweak to asan_device_setup.Evgeniy Stepanov2014-10-061-1/+2
| | | | | | | Add another wait-for-device which may fix a flaky setup error. Fix output message. llvm-svn: 219117
* [asan] Support Android/x86 in asan_device_setup.Evgeniy Stepanov2014-10-031-13/+28
| | | | llvm-svn: 218968
* [ASan] Don't use large stack buffer for local variable name in stack frame ↵Alexey Samsonov2014-10-011-17/+17
| | | | | | description llvm-svn: 218827
* [ASan] Make stack-buffer-overflow reports more robustAlexey Samsonov2014-10-014-46/+54
| | | | | | | | | | | | | | | | | | | | Summary: Fix the function that gets stack frame description by address in thread stack, so that it clearly indicates failures. Make this error non-fatal, and print as much information as we can in this case. Make all errors in ParseFrameDescription non-fatal. Test Plan: check-asan testsuite Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5554 llvm-svn: 218819
* [sanitizer] Add i686 arch to compiler-rt.Evgeniy Stepanov2014-10-011-1/+1
| | | | | | | | | | This is needed so we can produce -i686- named libraries for x86 Android (which is i686-linux-android). An alternative solution would be keeping the "i386" name internally and tweaking the OUTPUT_NAME of compiler-rt libraries. llvm-svn: 218761
* [asan] add a test for array cookie if the operator new is defined inside the ↵Kostya Serebryany2014-09-291-1/+2
| | | | | | class (the cookie should not be poisoned in such case); update the related comment in asan_poisoning.cc llvm-svn: 218620
* [sanitizer] Android build cleanup.Evgeniy Stepanov2014-09-293-56/+44
| | | | | | | | | | | | * 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. llvm-svn: 218605
* [asan] Fix SELinux setup on Android-K.Evgeniy Stepanov2014-09-291-2/+27
| | | | | | | On pre-L devices SELinux is set up in such a way that zygote wrapper has to be in system_file context, not zygote_exec. llvm-svn: 218599
* [compiler-rt] recommit of r218481: ASan debugging API for report info ↵Kuba Brecka2014-09-265-24/+208
| | | | | | | | | | extraction and locating addresses Reviewed at http://reviews.llvm.org/D4527 Fixed a test case failure on 32-bit Linux, I did right shift on intptr_t, instead it should have been uintptr_t. llvm-svn: 218538
OpenPOWER on IntegriCloud