Unverified Commit 744d4695 authored by Thurston Dang's avatar Thurston Dang Committed by GitHub
Browse files

[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 ea991a11) at runtime to ensure the shadow is mapped appropriately.
parent fd927359
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment