diff options
author | Thurston Dang <thurston@google.com> | 2024-04-24 10:38:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 10:38:12 -0700 |
commit | 744d469500d209b7bf548d81f607d61a156db2e6 (patch) | |
tree | b7831ca7b06659965293cd9bdaf053c2a4e3d976 /clang/unittests/libclang/LibclangTest.cpp | |
parent | fd9273593390c4e5004bba27eeeea60e44175dcf (diff) | |
download | llvm-744d469500d209b7bf548d81f607d61a156db2e6.zip llvm-744d469500d209b7bf548d81f607d61a156db2e6.tar.gz llvm-744d469500d209b7bf548d81f607d61a156db2e6.tar.bz2 |
[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.
Diffstat (limited to 'clang/unittests/libclang/LibclangTest.cpp')
0 files changed, 0 insertions, 0 deletions