[PATCH] D56603: [HWASAN] Improve tag-mismatch diagnostics

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 11 09:01:52 PST 2019


eugenis added inline comments.


================
Comment at: lib/hwasan/hwasan_checks.h:98
+    uptr next_p = RoundUpTo(p + 1, 1 << kShadowScale);
+    sz -= (next_p - p);
+    p = next_p;
----------------
This would report an error with the size of the memory access being equal to the distance from the first bad granule to the end of the memset() buffer. This sounds very confusing.

I suggest doing the sized version of SigTrap with the starting address and the full size of the buffer, and then adding extra analysis in reporting code. The result could be a note saying that the first bad byte is somewhere at offset [A, A+16] from the start of the accessed range.


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

https://reviews.llvm.org/D56603





More information about the llvm-commits mailing list