[all-commits] [llvm/llvm-project] 744d46: [hwasan] Optimize outlined memaccess for fixed sha...

Thurston Dang via All-commits all-commits at lists.llvm.org
Wed Apr 24 10:38:34 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 744d469500d209b7bf548d81f607d61a156db2e6
      https://github.com/llvm/llvm-project/commit/744d469500d209b7bf548d81f607d61a156db2e6
  Author: Thurston Dang <thurston at google.com>
  Date:   2024-04-24 (Wed, 24 Apr 2024)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/test/Instrumentation/HWAddressSanitizer/basic.ll
    M llvm/test/Instrumentation/HWAddressSanitizer/fixed-shadow.ll
    M llvm/test/Instrumentation/HWAddressSanitizer/prologue.ll

  Log Message:
  -----------
  [hwasan] Optimize outlined memaccess for fixed shadow on Aarch64 (#88544)

The HWASan transform currently always uses x20 to pass the shadow base to hwasan_check_memaccess_shortgranules, even if the shadow base is a constant known at compile time (e.g., for Fuchsia, KHWASan, or via -hwasan-mapping-offset).  This patch uses the fixed shadow variant of the hwasan_check_memaccess_shortgranules intrinsic (introduced in https://github.com/llvm/llvm-project/commit/365bddf634993d5ea357e9715d8aacd7ee40c4b5), allowing the shadow base to be materialized inside the memaccess callee.

We currently only support this optimization for AArch64; it is a no-op on other platforms due to lack of support for lowering the intrinsic.

Note: when a binary is instrumented with -hwasan-mapping-offset, it is necessary to specify HWASAN_OPTIONS=fixed_shadow_base=... (see ea991a11b2a3d2bfa545adbefb71cd17e8970a43) at runtime to ensure the shadow is mapped appropriately.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list