[PATCH] D102472: [HWASAN] Update the tag info for X86_64

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 18:08:07 PDT 2021


xiangzhangllvm added a comment.

Hello @morehouse, thanks for your work too:
1 OK, I'll break it up into 2 patches, one focus on changes in compiler, the other  focus on changes in compiler-rt.

2 In fact, We can divide it into two steps, Step 1 is "Tag correctness checking", Step 2 is "Hardware supporting point with tag".

   The option "ClUntagPointer" can help us first testing the Step 1.
   For example: we write 7 in to int *p, for HWASAN, we do 2 things:
   Step1:   Checking tag of p :
                call void @__hwasan_store4 (p_tagged)     // Checking tag is correct or not
   Step2:   Write 7 into mem:
                *p_tagged = 7          // Need Hardware supporting.  But if we use "ClUntagPointer" change "*p_tagged = 7" --> "*p = 7", we can run the program, and test Step 1 for HWASAN.
  
  For HWASAN, Most code in compiler and compiler-rt is doing work for Step 1. So we can use "ClUntagPointer" first test it.
  After we make sure Step 1 is OK, when the Hardware/OS is ready, we just need to totally/really enable HWASAN by just, I think, updating the system call in InitPrctl.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102472/new/

https://reviews.llvm.org/D102472



More information about the llvm-commits mailing list