summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan
Commit message (Collapse)AuthorAgeFilesLines
...
* Follow up to r283955: add _recalloc_base dll thunkReid Kleckner2016-10-121-0/+1
| | | | llvm-svn: 284059
* Fix _recalloc redefinition link error in ASan RTLReid Kleckner2016-10-111-0/+6
| | | | | | | | Fixes PR30329 Patch by Hans-Bernhard Broeker! llvm-svn: 283955
* [asan] Reapply: Switch to using dynamic shadow offset on iOSAnna Zaks2016-10-051-1/+1
| | | | | | | | The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset. Differential Revision: https://reviews.llvm.org/D25218 llvm-svn: 283375
* Revert "[asan] Switch to using dynamic shadow offset on iOS"Anna Zaks2016-10-051-1/+1
| | | | | | | | This reverts commit b2af965b7924ad793b313996a96633bb72daf629. Revert as these changes broke a Chromium buildbot. llvm-svn: 283349
* [asan] When protect_shadow_gap=0, set up the shadow for the shadow gap. This ↵Kostya Serebryany2016-10-042-17/+31
| | | | | | is needed to support NVIDIA CUDA drivers. Unfortunately, I don't know how to test it properly with CUDA on a public build bot, so adding a test that emulates the CUDA behavior. llvm-svn: 283270
* [asan] Switch to using dynamic shadow offset on iOSAnna Zaks2016-10-041-1/+1
| | | | | | | | The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset. Differential Revision: https://reviews.llvm.org/D25218 llvm-svn: 283240
* [sanitizer-coverage] remove stale code, second attempt after failed r282994Kostya Serebryany2016-10-041-2/+0
| | | | llvm-svn: 283185
* [compiler-rt] Add support for the dynamic shadow allocationEtienne Bergeron2016-09-306-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is adding support for dynamic shadow allocation. This is a merge and re-commit of the following patches. ``` [compiler-rt] Fix Asan build on Android https://reviews.llvm.org/D24768 [compiler-rt] Add support for the dynamic shadow allocation https://reviews.llvm.org/D23363 ``` This patch needed to re-land at the same time: ``` [asan] Support dynamic shadow address instrumentation https://reviews.llvm.org/D23354 ``` Reviewers: rnk, zaks.anna Subscribers: tberghammer, danalbert, kubabrecka, dberris, chrisha, llvm-commits Differential Revision: https://reviews.llvm.org/D25104 llvm-svn: 282882
* Don't use internal symbolizer if we are in process of reporting Out-of-Memory.Vitaly Buka2016-09-291-4/+3
| | | | | | Reviewed by eugenis offline, as reviews.llvm.org is down. llvm-svn: 282805
* [ASAN] Pass previous stack information through __sanitizer_finish_switch_fiberDmitry Vyukov2016-09-282-4/+15
| | | | | | | | | | | This patch extends __sanitizer_finish_switch_fiber method to optionally return previous stack base and size. This solves the problem of coroutines/fibers library not knowing the original stack context from which the library is used. It's incorrect to assume that such context is always the default stack of current thread (e.g. one such library may be used from a fiber/coroutine created by another library). Bulding a separate stack tracking mechanism would not only duplicate AsanThread, but also require each coroutines/fibers library to integrate with it. Author: Andrii Grynenko (andriigrynenko) Reviewed in: https://reviews.llvm.org/D24628 llvm-svn: 282582
* [asan, msan] Fix reallocation logic when IsInDlsymAllocPool(ptr) is true.Maxim Ostapenko2016-09-261-3/+5
| | | | llvm-svn: 282389
* [asan] Stop appending -lm, -pthread and other linker options on Darwin for ↵Kuba Brecka2016-09-231-6/+7
| | | | | | | | | | ASan unit tests On Darwin, -lm, -pthread and others are implied. -pthread currently produces a warning (compiler option unused). Differential Revision: https://reviews.llvm.org/D24698 llvm-svn: 282260
* [msan] Prevent initialization failure with newer (2.23+) glibc in use.Maxim Ostapenko2016-09-231-1/+5
| | | | | | | | | | This patch is pretty the same as http://reviews.llvm.org/D20235 that we used for ASan. Using the same hack for MSan fixes its initialization with newer Glibc in use. Differential Revision: https://reviews.llvm.org/D24736 llvm-svn: 282232
* [asan] Reify ErrorGenericFilipe Cabecinhas2016-09-214-241/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Finish work on PR30351 (last one, after D24551, D24552, and D24554 land) Also replace the old ReportData structure/variable with the current_error_ static member of the ScopedInErrorReport class. This has the following side-effects: - Move ASAN_ON_ERROR(); call to the start of the destructor, instead of in StartReporting(). - We only generate the error structure after the ScopedInErrorReport constructor finishes, so we can't call ASAN_ON_ERROR() during the constructor. I think this makes more sense, since we end up never running two of the ASAN_ON_ERROR() callback. This also works the same way as error reporting, since we end up having a lock around it. Otherwise we could end up with the ASAN_ON_ERROR() call for error 1, then the ASAN_ON_ERROR() call for error 2, and then lock the mutex for reporting error 1. - The __asan_get_report_* functions will be able to, in the future, provide information about other errors that aren't a "generic error". But we might want to rethink that API, since it's too restricted. Ideally we teach lldb about the current_error_ member of ScopedInErrorReport. Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24555 llvm-svn: 282107
* [asan] Store full AddressDescription objects in ErrorInvalidPointerPairFilipe Cabecinhas2016-09-212-7/+15
| | | | | | | | | | Reviewers: kcc, vitalybuka, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24777 llvm-svn: 282102
* revert 282085, 281909, they broke 32-bit dynamic ASan and the ↵Nico Weber2016-09-215-46/+32
| | | | | | sanitizer-windows bot llvm-svn: 282096
* [compiler-rt] Fix Asan build on AndroidEtienne Bergeron2016-09-212-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The dynamic shadow code is not detected correctly on Android. The android shadow seems to start at address zero. The bug is introduced here: https://reviews.llvm.org/D23363 Started here: https://build.chromium.org/p/chromium.fyi/builders/ClangToTAndroidASan/builds/4029 Likely due to an asan runtime change, filed https://llvm.org/bugs/show_bug.cgi?id=30462 From asan_mapping.h: ``` #if SANITIZER_WORDSIZE == 32 # if SANITIZER_ANDROID # define SHADOW_OFFSET (0) <<---- HERE # elif defined(__mips__) ``` Shadow address on android is 0. From asan_rtl.c: ``` if (shadow_start == 0) { [...] shadow_start = FindAvailableMemoryRange(space_size, alignment, granularity); } ``` We assumed that 0 is dynamic address. On windows, the address was determined with: ``` # elif SANITIZER_WINDOWS64 # define SHADOW_OFFSET __asan_shadow_memory_dynamic_address # else ``` and __asan_shadow_memory_dynamic_address is initially zero. Reviewers: rnk, eugenis, vitalybuka Subscribers: kcc, tberghammer, danalbert, kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D24768 llvm-svn: 282085
* [asan] Add C++17 aligned new/delete entrypoints. Patch by Jakub Jelinek, see ↵Kostya Serebryany2016-09-201-10/+52
| | | | | | https://reviews.llvm.org/D24771 llvm-svn: 282019
* [asan] Fix GlobalAddressDescription::Print()Filipe Cabecinhas2016-09-201-1/+2
| | | | | | | | | | | | Summary: Check bug_type for nullptr before calling internal_strcmp Reviewers: kcc, vitalybuka, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24773 llvm-svn: 282012
* [compiler-rt] Add support for the dynamic shadow allocationEtienne Bergeron2016-09-195-32/+35
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch is adding the needed code to compiler-rt to support dynamic shadow. This is to support this patch: https://reviews.llvm.org/D23354 It's adding support for using a shadow placed at a dynamic address determined at runtime. The dynamic shadow is required to work on windows 64-bits. Reviewers: rnk, kcc, vitalybuka Subscribers: kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D23363 llvm-svn: 281909
* [sanitizer] rename __sanitizer_symbolize_data to ↵Kostya Serebryany2016-09-191-1/+1
| | | | | | __sanitizer_symbolize_global (to avoid conflict with another definition) llvm-svn: 281902
* [sanitizer] add __sanitizer_symbolize_data (can only print the names of the ↵Kostya Serebryany2016-09-191-0/+1
| | | | | | globals for now) llvm-svn: 281886
* Remove undefined weak hooks from dll thunk export list to really fix windows ↵Reid Kleckner2016-09-161-12/+0
| | | | | | build llvm-svn: 281747
* [compiler-rt] Don't force ASAN_HAS_EXCEPTIONS to be true for all buildsFrancis Ricci2016-09-161-3/+0
| | | | | | | | | | | | | | Summary: This value is already defaulted to true in asan_internal.h. Allow the value to be overriden in cases where exceptions are unavailable. Reviewers: kcc, samsonov, compnerd Subscribers: kubabrecka, dberris, beanz, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D24633 llvm-svn: 281746
* [asan] provide dummy implementations for __sanitizer_cov_trace_pc_*Kostya Serebryany2016-09-151-0/+3
| | | | llvm-svn: 281677
* [sanitizer] Fixup: Do not introduce __sanitizer namespace globallyAnna Zaks2016-09-151-0/+2
| | | | | | Use the namespace in asan_win_dll_thunk.cc to fix the Windows bot. llvm-svn: 281659
* [compiler-rt] Do not introduce __sanitizer namespace globallyAnna Zaks2016-09-152-0/+4
| | | | | | | | | | | | The definitions in sanitizer_common may conflict with definitions from system headers because: The runtime includes the system headers after the project headers (as per LLVM coding guidelines). lib/sanitizer_common/sanitizer_internal_defs.h pollutes the namespace of everything defined after it, which is all/most of the sanitizer .h and .cc files and the included system headers with: using namespace __sanitizer; // NOLINT This patch solves the problem by introducing the namespace only within the sanitizer namespaces as proposed by Dmitry. Differential Revision: https://reviews.llvm.org/D21947 llvm-svn: 281657
* Really fix the Windows sanitizer buildReid Kleckner2016-09-152-4/+0
| | | | | | | | | | Don't list __sanitizer_print_memory profile as an INTERFACE_FUNCTION. It is not exported by ASan; it is exported by user code. Move the weak definition from asan_win.cc to sanitizer_win.cc to fix the ubsan tests. llvm-svn: 281619
* [asan] Reify ErrorInvalidPointerPairFilipe Cabecinhas2016-09-153-13/+30
| | | | | | | | | | | | Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24554 llvm-svn: 281593
* [asan] Reify ErrorODRViolationFilipe Cabecinhas2016-09-153-36/+61
| | | | | | | | | | | | Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24552 llvm-svn: 281592
* [asan] Reify ErrorBadParamsToAnnotateContiguousContainerFilipe Cabecinhas2016-09-153-13/+43
| | | | | | | | | | | | Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24551 llvm-svn: 281591
* Fix the Windows build after r281546Reid Kleckner2016-09-141-0/+3
| | | | llvm-svn: 281558
* [asan] fix windowsKostya Serebryany2016-09-141-0/+1
| | | | llvm-svn: 281548
* [compiler-rt] Set asan win 64-bits to use dynamic address for memory allocatorEtienne Bergeron2016-09-141-0/+4
| | | | | | | | | | | | | | | Summary: ASAN on Windows 64-bits should use a dynamic address instead of a fixed one. The asan-allocator code to support dynamic address is already landed. This patch is turning on the feature. Reviewers: rnk Subscribers: kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D24575 llvm-svn: 281522
* [asan] Reify ErrorStringFunctionSizeOverflowFilipe Cabecinhas2016-09-143-10/+37
| | | | | | | | | | | | Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24394 llvm-svn: 281444
* [asan] Reify ErrorStringFunctionMemoryRangesOverlapFilipe Cabecinhas2016-09-143-22/+61
| | | | | | | | | | | | Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24393 llvm-svn: 281443
* [asan] alloc_dealloc_mismatch=0 by default on Android.Evgeniy Stepanov2016-09-132-4/+2
| | | | | | | All known (to me) Android deployments are disabling this flag anyway. The in-tree script (asan_device_setup) does that, too. llvm-svn: 281410
* [asan] Reify ErrorSanitizerGetAllocatedSizeNotOwnedFilipe Cabecinhas2016-09-133-10/+35
| | | | | | | | | | | | Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24392 llvm-svn: 281392
* [asan] Reify ErrorMallocUsableSizeNotOwnedFilipe Cabecinhas2016-09-133-10/+33
| | | | | | | | | | | | Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24391 llvm-svn: 281391
* [asan] Reify ErrorAllocTypeMismatchFilipe Cabecinhas2016-09-133-19/+49
| | | | | | | | | | | | Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24390 llvm-svn: 281390
* [asan] Reify ErrorFreeNotMallocedFilipe Cabecinhas2016-09-133-15/+39
| | | | | | | | | | | | Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24389 llvm-svn: 281389
* Switch to 64-bit allocator on android/aarch64.Evgeniy Stepanov2016-09-131-2/+8
| | | | | | | This uses the "very compact" size class mapping that fits in the 39-bit address space. llvm-svn: 281371
* [asan] Re-poison all redzones on activation.Evgeniy Stepanov2016-09-131-0/+34
| | | | | | | | | | | | | When running with start_deactivated=1 in ASAN_OPTIONS, heap redzones are not poisoned until the first instrumented module is loaded. This can cause false negatives even on memory allocated after activation, because redzones are normally poisoned only once when a new allocator region is mapped. This change attempts to fix it by iterating over all existing allocator chunks and poisoning their redzones. llvm-svn: 281364
* [asan] Ease dealing with tagged enum ErrorDescription with some macros.Filipe Cabecinhas2016-09-121-32/+27
| | | | | | | | | | | | | | | Summary: Added a macro to enumerate the (error name, error member name) pairs. This way, when adding an error, we only need to add the pair to one place (plus add its implementation, or course). Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23875 llvm-svn: 281237
* [asan] Cleanup: Move tid into ErrorBase, add const to BufferedStackTrace, be ↵Filipe Cabecinhas2016-09-122-26/+25
| | | | | | | | | | | | | | | | consistent in constructor arguments and member order. Summary: As mentioned in D24394, I'm moving tid to ErrorBase, since basically all errors need it. Also mentioned in the same review are other cleanups like adding const to BufferedStackTrace and make sure constructor orders are consistent. Reviewers: vitalybuka, kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24455 llvm-svn: 281236
* [asan] Store access_size in the {Stack,Global}AddressDescription objectsFilipe Cabecinhas2016-09-092-20/+27
| | | | | | | | | | | | | | | Summary: This is important information when we want to describe errors, and should be part of these descriptions. Otherwise, we need to know the access size when printing/emitting the description. Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24387 llvm-svn: 281093
* [asan] Add a new AddressDescription structure, which can describe any type ↵Filipe Cabecinhas2016-09-094-76/+174
| | | | | | | | | | | | | | | | | | | | | | of address. Summary: This is useful for inclusion in the Error* structures, to describe an arbitrary address. Remove the old struct since it's used only once. This removes one level of indirection, and moves all *AddressDescription to be one of the recently introduced structures. This merges differential revisions: D24131 and D24132 Reviewers: kcc, eugenis, vitalybuka Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24131 llvm-svn: 281090
* [powerpc] Move #if to appease warnings-as-errors testsBill Seurer2016-09-081-3/+2
| | | | | | Previous patch added a #if which causes some unused identifier warnings. llvm-svn: 280976
* [asan] Handle SIGBART signal description. (found by buildbot)Filipe Cabecinhas2016-09-081-0/+2
| | | | llvm-svn: 280934
* [asan] Reify ErrorDeadlySignalFilipe Cabecinhas2016-09-087-71/+125
| | | | | | | | | | | | Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23873 llvm-svn: 280930
OpenPOWER on IntegriCloud