[compiler-rt] b49a3bf - [compiler-rt][hwasan][fuchsia] Implement TagMemoryAligned for fuchsia

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 16:28:51 PDT 2021


Author: Leonard Chan
Date: 2021-07-26T16:28:08-07:00
New Revision: b49a3bf7c094d7c76eb8a4774ae9aded84dafa41

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

LOG: [compiler-rt][hwasan][fuchsia] Implement TagMemoryAligned for fuchsia

This will just be a call into __sanitizer_fill_shadow defined in the fuchsia source tree. This depends on D105663.

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

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 566bb80c9222..e299a7e862eb 100644
--- a/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
@@ -152,6 +152,14 @@ static void ThreadExitHook(void *hook, thrd_t self) {
   hwasanThreadList().ReleaseThread(thread);
 }
 
+uptr TagMemoryAligned(uptr p, uptr size, tag_t tag) {
+  CHECK(IsAligned(p, kShadowAlignment));
+  CHECK(IsAligned(size, kShadowAlignment));
+  __sanitizer_fill_shadow(p, size, tag,
+                          common_flags()->clear_shadow_mmap_threshold);
+  return AddTagToPointer(p, tag);
+}
+
 // Not implemented because Fuchsia does not use signal handlers.
 void HwasanOnDeadlySignal(int signo, void *info, void *context) {}
 


        


More information about the llvm-commits mailing list