[compiler-rt] c211041 - [hwasan][fuchsia] Fix features bitmask checking

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 14:43:20 PDT 2022


Author: Leonard Chan
Date: 2022-07-07T14:43:00-07:00
New Revision: c21104180266d22584043983972f350ef33c5e12

URL: https://github.com/llvm/llvm-project/commit/c21104180266d22584043983972f350ef33c5e12
DIFF: https://github.com/llvm/llvm-project/commit/c21104180266d22584043983972f350ef33c5e12.diff

LOG: [hwasan][fuchsia] Fix features bitmask checking

Update the address tagging bitmask check to just see if
ZX_ARM64_FEATURE_ADDRESS_TAGGING_TBI is enabled rather than checking
if it's the only thing that's enabled.

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

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_fuchsia.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp b/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
index b066d4fdd1142..967c796c339d0 100644
--- a/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
@@ -190,11 +190,11 @@ void InitializeOsSupport() {
   uint32_t features = 0;
   CHECK_EQ(zx_system_get_features(ZX_FEATURE_KIND_ADDRESS_TAGGING, &features),
            ZX_OK);
-  if (features != ZX_ARM64_FEATURE_ADDRESS_TAGGING_TBI &&
+  if (!(features & ZX_ARM64_FEATURE_ADDRESS_TAGGING_TBI) &&
       flags()->fail_without_syscall_abi) {
     Printf(
-        "FATAL: HWAddressSanitizer requires a kernel with tagged address "
-        "ABI.\n");
+        "FATAL: HWAddressSanitizer requires "
+        "ZX_ARM64_FEATURE_ADDRESS_TAGGING_TBI.\n");
     Die();
   }
 #endif


        


More information about the llvm-commits mailing list