[PATCH] D56672: [HWASAN] Instrument globals

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 13:12:32 PST 2019


eugenis added a comment.

In D56672#1357619 <https://reviews.llvm.org/D56672#1357619>, @evgeny777 wrote:

> > even for internal / non-preemptible globals.
>
> Why so? The only case I can imagine is ThinLTO promotion, but in such case instrumented code is imported as well


OK, not internal, but external non-preemptible for sure because they can be accessed directly from outside, and then the only source of truth for the variable's tag would be the GOT entry.

Internal variables can use a different approach, maybe based on a hash of the name (if there is one!) like in this patch.

> 
> 
>> I wonder if the same could be achieved with a clever use of ifunc?
> 
> Do you mean generating ifunc for each instrumented global and tagging a pointer there?

Yes, but I'm having doubts about how well this case (data-ifunc) is supported in the toolchain(s). If at all.


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

https://reviews.llvm.org/D56672





More information about the llvm-commits mailing list