summaryrefslogtreecommitdiff
path: root/lib/asan/asan_mapping.h
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-08-07 22:38:44 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-08-07 22:38:44 +0000
commite039aacf55a27bce76e7e6f695fefa8d1757371d (patch)
treef694da172b9157f9de4a0e35d3cb4cddf69a294c /lib/asan/asan_mapping.h
parent2bc2521503970a37ff34984cdaa9b0e1a2ab7ec5 (diff)
[asan] Try different values of the shadow gap start.
The number of unaccessible pages at the beginning of the address space can differ between processes on the same machine. Try different values at runtime to protect as much memory as possible. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_mapping.h')
-rw-r--r--lib/asan/asan_mapping.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/asan/asan_mapping.h b/lib/asan/asan_mapping.h
index 8b4857e6d..937c57b28 100644
--- a/lib/asan/asan_mapping.h
+++ b/lib/asan/asan_mapping.h
@@ -178,7 +178,8 @@ static const u64 kWindowsShadowOffset32 = 3ULL << 28; // 0x30000000
// With the zero shadow base we can not actually map pages starting from 0.
// This constant is somewhat arbitrary.
-#define kZeroBaseShadowStart 4096
+#define kZeroBaseShadowStart 0
+#define kZeroBaseMaxShadowStart (1 << 18)
#define kShadowGapBeg (kLowShadowEnd ? kLowShadowEnd + 1 \
: kZeroBaseShadowStart)