[PATCH] D63908: hwasan: Improve precision of checks using short granule tags.

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 21 23:53:27 PST 2020


pcc added inline comments.


================
Comment at: compiler-rt/trunk/lib/hwasan/hwasan_checks.h:76
+#endif
+  return *(u8 *)(ptr | (kShadowAlignment - 1)) == ptr_tag;
+}
----------------
xiangzhangllvm wrote:
> Hello @pcc I think here seems some problem, the ptr is user passing point,
> *(ptr + n) should have the user's real data. it shouldn't  "== ptr_tag".
If this is a short granule then from the user's perspective the maximum size of the granule is (granule size - 1). This means that the last byte of the granule is free for us to use to store the granule's real tag.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63908



More information about the cfe-commits mailing list