summaryrefslogtreecommitdiff
path: root/libsanitizer/hwasan/hwasan_dynamic_shadow.cpp
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-05-12 14:37:22 +0200
committerMartin Liska <mliska@suse.cz>2021-05-13 09:29:17 +0200
commitd0fee87e0ce24f066cde3dbf9605abce24dd75e1 (patch)
tree9172c165d55d36021fa70059ed0e9fef5324119e /libsanitizer/hwasan/hwasan_dynamic_shadow.cpp
parent810afb0b5fbb9da1e0e51ee9607f275f14c17459 (diff)
libsanitizer: merge from master
Merged revision: f58e0513dd95944b81ce7a6e7b49ba656de7d75f
Diffstat (limited to 'libsanitizer/hwasan/hwasan_dynamic_shadow.cpp')
-rw-r--r--libsanitizer/hwasan/hwasan_dynamic_shadow.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/libsanitizer/hwasan/hwasan_dynamic_shadow.cpp b/libsanitizer/hwasan/hwasan_dynamic_shadow.cpp
index 12730b29bae..f53276e330d 100644
--- a/libsanitizer/hwasan/hwasan_dynamic_shadow.cpp
+++ b/libsanitizer/hwasan/hwasan_dynamic_shadow.cpp
@@ -12,15 +12,17 @@
///
//===----------------------------------------------------------------------===//
-#include "hwasan.h"
#include "hwasan_dynamic_shadow.h"
-#include "hwasan_mapping.h"
-#include "sanitizer_common/sanitizer_common.h"
-#include "sanitizer_common/sanitizer_posix.h"
#include <elf.h>
#include <link.h>
+#include "hwasan.h"
+#include "hwasan_mapping.h"
+#include "hwasan_thread_list.h"
+#include "sanitizer_common/sanitizer_common.h"
+#include "sanitizer_common/sanitizer_posix.h"
+
// The code in this file needs to run in an unrelocated binary. It should not
// access any external symbol, including its own non-hidden globals.
@@ -117,6 +119,12 @@ namespace __hwasan {
void InitShadowGOT() {}
uptr FindDynamicShadowStart(uptr shadow_size_bytes) {
+#if defined(__x86_64__)
+ constexpr uptr kAliasSize = 1ULL << kAddressTagShift;
+ constexpr uptr kNumAliases = 1ULL << kTagBits;
+ return MapDynamicShadowAndAliases(shadow_size_bytes, kAliasSize, kNumAliases,
+ RingBufferSize());
+#endif
return MapDynamicShadow(shadow_size_bytes, kShadowScale, kShadowBaseAlignment,
kHighMemEnd);
}