[compiler-rt] 9fcd2b6 - [hwasan] Untag destination address in hwasan_posix_memalign.

Evgenii Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 16:40:56 PDT 2020


Author: Evgenii Stepanov
Date: 2020-05-08T16:35:48-07:00
New Revision: 9fcd2b68e76bf0412919e7cb2acd078af828cfa2

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

LOG: [hwasan] Untag destination address in hwasan_posix_memalign.

Required on X86 because no TBI.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_allocator.cpp b/compiler-rt/lib/hwasan/hwasan_allocator.cpp
index 81a57d3afd4d..1d82db0e3944 100644
--- a/compiler-rt/lib/hwasan/hwasan_allocator.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_allocator.cpp
@@ -363,7 +363,7 @@ int hwasan_posix_memalign(void **memptr, uptr alignment, uptr size,
     // OOM error is already taken care of by HwasanAllocate.
     return errno_ENOMEM;
   CHECK(IsAligned((uptr)ptr, alignment));
-  *memptr = ptr;
+  *(void **)UntagPtr(memptr) = ptr;
   return 0;
 }
 


        


More information about the llvm-commits mailing list