summaryrefslogtreecommitdiff
path: root/lib/asan/asan_mapping.h
AgeCommit message (Collapse)Author
2013-02-15[asan] make asan work with 7fff8000 offset and prelinkKostya Serebryany
When prelink is installed in the system, prelink-ed libraries map between 0x003000000000 and 0x004000000000 thus occupying the shadow Gap, so we need so split the address space even further, like this: || [0x10007fff8000, 0x7fffffffffff] || HighMem || || [0x02008fff7000, 0x10007fff7fff] || HighShadow || || [0x004000000000, 0x02008fff6fff] || ShadowGap3 || || [0x003000000000, 0x003fffffffff] || MidMem || || [0x00087fff8000, 0x002fffffffff] || ShadowGap2 || || [0x00067fff8000, 0x00087fff7fff] || MidShadow || || [0x00008fff7000, 0x00067fff7fff] || ShadowGap || || [0x00007fff8000, 0x00008fff6fff] || LowShadow || || [0x000000000000, 0x00007fff7fff] || LowMem || Do it only if necessary. Also added a bit of profiling code to make sure that the mapping code is efficient. Added a lit test to simulate prelink-ed libraries. Unfortunately, this test does not work with binutils-gold linker. If gold is the default linker the test silently passes. Also replaced __has_feature(address_sanitizer) with __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) in two places. Patch partially by Jakub Jelinek. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175263 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13[asan] fix fixed mapping for mac (ASAN_FLEXIBLE_MAPPING_AND_OFFSET=0)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175049 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12[asan] change the default mapping offset on x86_64 to 0x7fff8000. This gives ↵Kostya Serebryany
roughly 5% speedup. Since this is an ABI change, bump the asan ABI version by renaming __asan_init to __asan_init_v1. compiler-rt part git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23[sanitizer] increase the minimal mmap size in allocator to 2^16; fix the ↵Kostya Serebryany
asan Mac build git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173261 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23[asan] initialize kHighMemEnd at startup (instead of at compile time) to ↵Kostya Serebryany
simplify further changes for various address space layouts. Fix asan_allocator2 for PowerPC (tested on 44-bit address space) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173260 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23[asan] simplify the code that poisons global redzones, add some more testsKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21Fixup for r173021: build tests with zero-based shadow on Android only, fix ↵Alexey Samsonov
condition in checking for shadow gap in asan_mapping.h git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173026 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21ASan: build unit tests with -fsanitize-address-zero-base-shadow on Linux and ↵Alexey Samsonov
Android git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173021 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28[ASan] use macro instead of raw __attribute__Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171188 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-24[asan/tsan] get rid of kPageSize completely in favor of GetPageSizeCached(). ↵Kostya Serebryany
This makes the code friendly to more platforms git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@168537 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-21[asan/tsan] do not use __WORDSIZE macro, as it is glibc-private thing. ↵Kostya Serebryany
Instead, define our own SANITIZER_WORDSIZE git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@168424 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-20[asan] more support for powerpc, patch by Peter BergnerKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@168356 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27A few tweaks for building ASanRT against Android NDK.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162666 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23For wild addresses in the shadow or shadow gap areas print an error message ↵Alexander Potapenko
instead of crashing on a check. Add AddressSanitizer.MemsetWildAddressTest that makes sure a proper error message is printed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@160620 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31[asan] more renamingKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157747 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31[asan] more renamingKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23Use zero-based shadow by default on Android.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157318 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-12Fix GetFrameNameByAddr hitting stale stack guards.Evgeniy Stepanov
In the current implementation AsanThread::GetFrameNameByAddr scans the stack for a magic guard value to locate base address of the stack frame. This is not reliable, especially on ARM, where the code that stores this magic value has to construct it in a register from two small intermediates; this register can then end up stored in a random stack location in the prologue of another function. With this change, GetFrameNameByAddr scans the shadow memory for the signature of a left stack redzone instead. It is now possible to remove the magic from the instrumentation pass for additional performance gain. We keep it there for now just to make sure the new algorithm does not fail in some corner case. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156710 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15[asan] performance optimization: make sure the check for poisoned shadow ↵Kostya Serebryany
inside inteceptors is inlined git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@152767 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-30Refactor shadow poisoning done by asan-rt, no funtionality changes; patch by ↵Kostya Serebryany
samsonov@google.com git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@145505 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-30AddressSanitizer run-time library. Not yet integrated with the compiler-rt ↵Kostya Serebryany
build system, but can be built using the old makefile. See details in README.txt git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@145463 91177308-0d34-0410-b5e6-96231b3b80d8