summaryrefslogtreecommitdiff
path: root/lib/asan/asan_poisoning.h
Commit message (Collapse)AuthorAgeFilesLines
* [ASan] Use __sanitizer_fill_shadow for FastPoisonShadow on FuchsiaPetr Hosek2019-07-111-4/+6
| | | | | | | | This is the optimized implementation for Fuchsia provided by the libc. Differential Revision: https://reviews.llvm.org/D64166 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365739 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Trivial portion of the port to Myriad RTEMSWalter Lee2018-05-181-0/+3
| | | | | | | | | | | | | | | | | | | | | This commit contains the trivial portion of the port of ASan to Myriad RTEMS. - Whitelist platform in sanitizer_platform.h, ubsan_platform.h - Turn off general interception - Use memset for FastPoisonShadow - Define interception wrappers - Set errno symbol correctly - Enable ASAN_LOW_MEMORY - Enable preinit array - Disable slow unwinding - Use fuchsia offline symbolizer - Disable common code for: InitializeShadowMemory, CreateMainThread, AsanThread::ThreadStart, StartReportDeadlySignal, MaybeReportNonExecRegion. Differential Revision: https://reviews.llvm.org/D46454 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332681 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] poison_heap=0 should not disable __asan_handle_no_return.Evgeniy Stepanov2018-03-121-1/+1
| | | | | | | | | | Reviewers: kcc, alekseyshl, vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44339 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327337 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Complete the Fuchsia portVitaly Buka2017-08-091-2/+5
| | | | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: kcc, eugenis, alekseyshl, vitalybuka Reviewed By: vitalybuka Subscribers: filcab, vitalybuka, srhines, kubamracek, mgorny, phosek, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D35865 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310431 91177308-0d34-0410-b5e6-96231b3b80d8
* Release memory to OS only when the requested range covers the entire pageEvgeniy Stepanov2016-11-301-2/+2
| | | | | | | | | | | | | | | | | Summary: The current code was sometimes attempting to release huge chunks of memory due to undesired RoundUp/RoundDown interaction when the requested range is fully contained within one memory page. Reviewers: eugenis Subscribers: kubabrecka, llvm-commits Patch by Aleksey Shlyapnikov. Differential Revision: https://reviews.llvm.org/D27228 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@288271 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] first attempt at releasing free-d memory back to the system using ↵Kostya Serebryany2016-08-261-1/+1
| | | | | | madvise. Requires quite some tuning. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279887 91177308-0d34-0410-b5e6-96231b3b80d8
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-291-1/+1
| | | | | | | | | | | | | | | | | | | This is done by creating a named shared memory region, unlinking it and setting up a private (i.e. copy-on-write) mapping of that instead of a regular anonymous mapping. I've experimented with regular (sparse) files, but they can not be scaled to the size of MSan shadow mapping, at least on Linux/X86_64 and ext3 fs. Controlled by a common flag, decorate_proc_maps, disabled by default. This patch has a few shortcomings: * not all mappings are annotated, especially in TSan. * our handling of memset() of shadow via mmap() puts small anonymous mappings inside larger named mappings, which looks ugly and can, in theory, hit the mapping number limit. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@238621 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usageKostya Serebryany2015-01-211-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226636 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Introduce SetCanPoisonMemory() function.Alexey Samsonov2014-12-171-2/+6
| | | | | | | | | | SetCanPoisonMemory()/CanPoisonMemory() functions are now used instead of "poison_heap" flag to determine if ASan is allowed to poison the shadow memory. This allows to hot-patch this value in runtime (e.g. during ASan activation) without introducing a data race. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224395 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Remove the call to GetPageSizeCached from fast path of FastPoisonShadowAlexey Samsonov2014-09-041-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217194 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around PR19125: -Wconstant-logical-operand false positiveTimur Iskhodzhanov2014-03-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203782 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable fast shadow zero'ing on WindowsTimur Iskhodzhanov2014-03-131-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203778 91177308-0d34-0410-b5e6-96231b3b80d8
* FastPoisonShadow: check for MmapFixedNoReserve failuresTimur Iskhodzhanov2014-03-131-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203776 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Use mmap to zero-fill large shadow regions.Evgeniy Stepanov2014-02-141-1/+21
| | | | | | | | | | | | This is covered by existing ASan test. This does not change anything for TSan by default (but provides a flag to change the threshold size). Based on a patch by florent.bruneau here:   https://code.google.com/p/address-sanitizer/issues/detail?id=256 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201400 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] when a fake stack is being unmapped also flush the corresponding shadowKostya Serebryany2013-12-111-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197040 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] introduce run-time flag 'poison_partial' Kostya Serebryany2013-10-161-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192793 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] introduce LargeMmapAllocator::GetBlockBeginFastSingleThreaded, ↵Kostya Serebryany2013-05-301-1/+2
| | | | | | required for LeakSanitizer to work faster. Also fix lint. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182917 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MSVC W3 compiler warningsTimur Iskhodzhanov2013-05-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182857 91177308-0d34-0410-b5e6-96231b3b80d8
* Make all the ALWAYS_INLINE users Windows-friendly; also, avoid ALWAYS_INLINE ↵Timur Iskhodzhanov2013-03-281-2/+2
| | | | | | INLINE combinations git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178266 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Speed-up initialization-order checking: create and use fast versions ↵Alexey Samsonov2013-03-281-0/+58
of PoisonShadow functions, store copies of __asan_global descriptors in a vector instead of list of pointers. This gives 3x speedup on both benchmarks and real binaries with lots of globals. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178239 91177308-0d34-0410-b5e6-96231b3b80d8