[PATCH] D108457: [hwasan] Do not instrument accesses to uninteresting allocas.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 13:27:13 PDT 2021


eugenis accepted this revision.
eugenis added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:786
+  if (!InstrumentStack) {
+    if (findAllocaForValue(Ptr))
+      return true;
----------------
I'm still on the fence about this. A stack pointer can be used to access heap if the offset is attacker controlled, but that sounds a bit exotic.

But let's land it like this for now.

One thing I'd like to explore is applying the same SCEV computation as in StackSafetyAnalysis and excluding instrumentation for anything with offset provably within 32 bits or less - that should be reasonably common (indices are often int, not long) and safe (heap is unlikely to be within 4Gb from stack on 64-bit).



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108457



More information about the llvm-commits mailing list