summaryrefslogtreecommitdiff
path: root/lib/asan/asan_poisoning.h
AgeCommit message (Collapse)Author
2017-08-09[asan] Complete the Fuchsia portVitaly Buka
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
2016-11-30Release memory to OS only when the requested range covers the entire pageEvgeniy Stepanov
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
2016-08-26[asan] first attempt at releasing free-d memory back to the system using ↵Kostya Serebryany
madvise. Requires quite some tuning. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279887 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov
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
2015-01-21[asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usageKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226636 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-17[ASan] Introduce SetCanPoisonMemory() function.Alexey Samsonov
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
2014-09-04[ASan] Remove the call to GetPageSizeCached from fast path of FastPoisonShadowAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217194 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13Work around PR19125: -Wconstant-logical-operand false positiveTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203782 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13Disable fast shadow zero'ing on WindowsTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203778 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13FastPoisonShadow: check for MmapFixedNoReserve failuresTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203776 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14[sanitizer] Use mmap to zero-fill large shadow regions.Evgeniy Stepanov
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
2013-12-11[asan] when a fake stack is being unmapped also flush the corresponding shadowKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197040 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16[asan] introduce run-time flag 'poison_partial' Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192793 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-30[sanitizer] introduce LargeMmapAllocator::GetBlockBeginFastSingleThreaded, ↵Kostya Serebryany
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
2013-05-29Fix MSVC W3 compiler warningsTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182857 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28Make all the ALWAYS_INLINE users Windows-friendly; also, avoid ALWAYS_INLINE ↵Timur Iskhodzhanov
INLINE combinations git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178266 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28[ASan] Speed-up initialization-order checking: create and use fast versions ↵Alexey Samsonov
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