This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by alekseyshl on Apr 19 2018, 4:08 PM.

Details

Summary

Retire the fixed shadow memory mapping to avoid conflicts with default
process memory mapping (currently manifests on Android).

Tests on AArch64 show <1% performance loss and code size increase,
making it possible to use dynamic shadow memory by default.

For the simplicity and unifirmity sake, use dynamic shadow memory mapping
with base address accessed via ifunc resolver on all supported platforms.

Keep the fixed shadow memory mapping around to be able to run
performance comparison tests later.

Complementing D45840.

Diff Detail

Event Timeline

alekseyshl created this revision.Apr 19 2018, 4:08 PM
Herald added subscribers: Restricted Project, delcypher, kristof.beyls and 4 others. · View Herald TranscriptApr 19 2018, 4:08 PM
eugenis accepted this revision.Apr 19 2018, 5:32 PM

That's a lot of code :(
But I don't see anything that could be thrown or factored out. We don't really need fixed (zero-based) stuff, but it's good to have it around for a while (for benchmarks and such).

lib/hwasan/hwasan_dynamic_shadow.h
2

this file is named differently (and some others, too)

This revision is now accepted and ready to land.Apr 19 2018, 5:32 PM
alekseyshl marked an inline comment as done.
  • Fix file comments and check more approriate condition for the PIE/ASLR warning.
This revision was automatically updated to reflect the committed changes.