Skip to content

Commit

Permalink
Revert "[hwasan] Add fixed_shadow_base flag" (#95435)
Browse files Browse the repository at this point in the history
Reverts #73980

This broke static hwasan binaries in Android, for some reason the
fixed_shadow_base branch gets taken
  • Loading branch information
fmayer committed Jun 13, 2024
1 parent 6499c5d commit 12f77e8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 89 deletions.
7 changes: 0 additions & 7 deletions compiler-rt/lib/hwasan/hwasan_flags.inc
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,3 @@ HWASAN_FLAG(bool, malloc_bisect_dump, false,
// are untagged before the call.
HWASAN_FLAG(bool, fail_without_syscall_abi, true,
"Exit if fail to request relaxed syscall ABI.")

HWASAN_FLAG(
uptr, fixed_shadow_base, -1,
"If not -1, HWASan will attempt to allocate the shadow at this address, "
"instead of choosing one dynamically."
"Tip: this can be combined with the compiler option, "
"-hwasan-mapping-offset, to optimize the instrumentation.")
8 changes: 2 additions & 6 deletions compiler-rt/lib/hwasan/hwasan_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,8 @@ static uptr GetHighMemEnd() {
}

static void InitializeShadowBaseAddress(uptr shadow_size_bytes) {
if (flags()->fixed_shadow_base != (uptr)-1) {
__hwasan_shadow_memory_dynamic_address = flags()->fixed_shadow_base;
} else {
__hwasan_shadow_memory_dynamic_address =
FindDynamicShadowStart(shadow_size_bytes);
}
__hwasan_shadow_memory_dynamic_address =
FindDynamicShadowStart(shadow_size_bytes);
}

static void MaybeDieIfNoTaggingAbi(const char *message) {
Expand Down
76 changes: 0 additions & 76 deletions compiler-rt/test/hwasan/TestCases/Linux/fixed-shadow.c

This file was deleted.

0 comments on commit 12f77e8

Please sign in to comment.