Index: lib/dfsan/dfsan.h =================================================================== --- lib/dfsan/dfsan.h +++ lib/dfsan/dfsan.h @@ -49,7 +49,11 @@ #elif defined(__mips64) return (dfsan_label *) ((((uptr) ptr) & ~0xF000000000) << 1); #elif defined(__aarch64__) +# if SANITIZER_AARCH64_VMA == 39 return (dfsan_label *) ((((uptr) ptr) & ~0x7800000000) << 1); +# elif SANITIZER_AARCH64_VMA == 42 + return (dfsan_label *) ((((uptr) ptr) & ~0x3c000000000) << 1); +# endif #endif } Index: lib/dfsan/dfsan.cc =================================================================== --- lib/dfsan/dfsan.cc +++ lib/dfsan/dfsan.cc @@ -96,6 +96,22 @@ // | reserved by kernel | // +--------------------+ 0x0000000000 +// On Linux/AArch64 (42-bit VMA), memory is laid out as follow: +// +// +--------------------+ 0x40000000000 (top of memory) +// | application memory | +// +--------------------+ 0x3ff00008000 (kAppAddr) +// | | +// | unused | +// | | +// +--------------------+ 0x1200000000 (kUnusedAddr) +// | union table | +// +--------------------+ 0x1000000000 (kUnionTableAddr) +// | shadow memory | +// +--------------------+ 0x0000010000 (kShadowAddr) +// | reserved by kernel | +// +--------------------+ 0x0000000000 + typedef atomic_dfsan_label dfsan_union_table_t[kNumLabels][kNumLabels]; #if defined(__x86_64__) @@ -110,9 +126,17 @@ static const uptr kAppAddr = 0xF000008000; #elif defined(__aarch64__) static const uptr kShadowAddr = 0x10000; +# if SANITIZER_AARCH64_VMA == 39 static const uptr kUnionTableAddr = 0x1000000000; +# elif SANITIZER_AARCH64_VMA == 42 +static const uptr kUnionTableAddr = 0x8000000000; +# endif static const uptr kUnusedAddr = kUnionTableAddr + sizeof(dfsan_union_table_t); +# if SANITIZER_AARCH64_VMA == 39 static const uptr kAppAddr = 0x7000008000; +# elif SANITIZER_AARCH64_VMA == 42 +static const uptr kAppAddr = 0x3ff00008000; +# endif #else # error "DFSan not supported for this platform!" #endif