[PATCH] D108457: [hwasan] Do not instrument accesses to uninteresting allocas.
Florian Mayer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 6 05:56:46 PDT 2021
fmayer added a comment.
In D108457#2984855 <https://reviews.llvm.org/D108457#2984855>, @fmayer wrote:
> In D108457#2983236 <https://reviews.llvm.org/D108457#2983236>, @eugenis wrote:
>
>> What if an instruction may access either stack or heap?
>>
>> i32 *p = flag ? p_heap_i16 : &stack_i32;
>> *p = 42;
>>
>> The analysis will say "safe" because it is only scanning from the stack roots.
>> This should probably be fixed in hwasan by tracking the underlying alloca.
>
> Ah yes, I did handle this but then accidentally lost that when I refactored around some stuff. Put that back and added an IR test.
Thinking again I remembered why I removed the explicit case for this during the refactoring: in this case, SCEV will not be able to calculate an in-range offset between the operator of the store and the alloca, so it will not be judged a safe access
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