eugenis added inline comments.

================
Comment at: compiler-rt/lib/hwasan/hwasan_allocator.cpp:159
                     ? (t ? t->GenerateRandomTag() : kFallbackAllocTag)
                     : 0;
+    uptr tag_size = orig_size ? orig_size : 1;
----------------
When !(flags()->tag_in_malloc && malloc_bisect(stack, orig_size)), the tail tag 
should be 0 as well.


================
Comment at: compiler-rt/lib/hwasan/hwasan_checks.h:69
+    return true;
+  if (mem_tag > 15)
+    return false;
----------------
s/15/kShadowAlignment -1/


================
Comment at: compiler-rt/lib/hwasan/hwasan_checks.h:113
+  if (UNLIKELY(tail_sz != 0 && !PossiblyShortTagMatches(
+                                   *shadow_last, end & ~0xfull, tail_sz))) {
+    SigTrap<0x20 * (EA == ErrorAction::Recover) +
----------------
0xfull, nice :)
A named constant please.


================
Comment at: llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:1195
+      auto *NewAI = new AllocaInst(
+          TypeWithPadding, AI->getType()->getAddressSpace(), nullptr, "", AI);
+      NewAI->takeName(AI);
----------------
Good. I think we will need to do the same in MTE patches, but for different 
reason.

There is something in BasicAA that thinks that a store of size 16 (in 
MachineInstr) can not possibly alias with a smaller alloca, so simply 
increasing alloca alignment is not enough.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63908



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to