[all-commits] [llvm/llvm-project] b33dcc: [hwasan] support hwasan-match-all-tag flag for cal...

Enna1 via All-commits all-commits at lists.llvm.org
Fri May 26 19:28:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b33dcc5b1eda6a564138b0e86f726abf269fb561
      https://github.com/llvm/llvm-project/commit/b33dcc5b1eda6a564138b0e86f726abf269fb561
  Author: Enna1 <xumingjie.enna1 at bytedance.com>
  Date:   2023-05-27 (Sat, 27 May 2023)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan.cpp
    M compiler-rt/lib/hwasan/hwasan_interface_internal.h
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/test/Instrumentation/HWAddressSanitizer/with-calls.ll

  Log Message:
  -----------
  [hwasan] support hwasan-match-all-tag flag for callback memory access instrumentation

Currently, hwasan-match-all-tag flag is supported in inline memory access instrumentation and outline memory access instrumentation, but not supported in callback memory access instrumentation.

- For inline memory access instrumentation: a hwasan-match-all-tag check is added following the tag-mismtach check, if tag from pointer is mismatched with tag from shadow memory and tag from pointer is not equal with hwasan-match-all-tag, then a tag-mismatch will be report.
- For outline memory acess instrumentation: MatchAllTag is encoded in AccessInfo, when emit HWASAN memaccess symbols, asm-printer emits assembly instructions to check if tag from pointer is equal with hwasan-match-all-tag.
- For callback memory access instrumentation: hwasan-match-all-tag check is not implemented in `__hwasan_load`/`__hwasan_store`.

This patch implements a set of callback functions: `__hwasan_[load|store][1|2|4|8|16|n]_match_all` and `__hwasan_load[load|store][1|2|4|8|16|n]_match_all_noabort`, making hwasan-match-all-tag flag working for callback memory access instrumentation.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D149580




More information about the All-commits mailing list