This is an archive of the discontinued LLVM Phabricator instance.

[HWASan] Introduce non-zero based and dynamic shadow memory (LLVM).
ClosedPublic

Authored by alekseyshl on Apr 19 2018, 3:13 PM.

Details

Summary

Support the dynamic shadow memory offset (the default case for user
space now) and static non-zero shadow memory offset
(-hwasan-mapping-offset option). Keeping the the latter case around
for functionality and performance comparison tests (and mostly for
-hwasan-mapping-offset=0 case).

The implementation is stripped down ASan one, picking only the relevant
parts in the following assumptions: shadow scale is fixed, the shadow
memory is dynamic, it is accessed via ifunc global, shadow memory address
rematerialization is suppressed.

Keep zero-based shadow memory for kernel (-hwasan-kernel option) and
calls instreumented case (-hwasan-instrument-with-calls option), which
essentially means that the generated code is not changed in these cases.

Diff Detail

Repository
rL LLVM

Event Timeline

alekseyshl created this revision.Apr 19 2018, 3:13 PM
kcc added a subscriber: kcc.Apr 19 2018, 5:00 PM

plz don't forget to update the documentation (the asm snippet) at clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

eugenis accepted this revision.Apr 19 2018, 5:15 PM

LGTM

This revision is now accepted and ready to land.Apr 19 2018, 5:15 PM