This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] [dfsan] Unify aarch64 mapping
ClosedPublic

Authored by zatrazz on Nov 16 2015, 12:57 PM.

Details

Summary

This patch adds a DFSan option to read the application shadow mask
value from an external source instead of use static defined integers.
It is used on architectures with multiple VMA that might place the
application data in different regions.

The patch also adjust the aarch64 instrumentation to use this new
option making the SANITIZER_AARCH64_VMA build option not required
anymore.

Along with this patch a compiler-rt one will also be added to export
the shadow mask variable.

Diff Detail

Event Timeline

zatrazz updated this revision to Diff 40323.Nov 16 2015, 12:57 PM
zatrazz retitled this revision from to [compiler-rt] [dfsan] Unify aarch64 mapping.
zatrazz updated this object.
zatrazz added a subscriber: llvm-commits.
zatrazz retitled this revision from [compiler-rt] [dfsan] Unify aarch64 mapping to [sanitizer] [dfsan] Unify aarch64 mapping.Nov 16 2015, 1:33 PM
zatrazz updated this object.
pcc edited edge metadata.Nov 16 2015, 7:49 PM

Test case please.

lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
78

Shado -> Shadow

135

There is no need to add a flag for this; you can derive it directly from the target.

441

This is the same type as IntptrTy.

943

Please create this global in DataFlowSanitizer::runOnModule with the others.

zatrazz updated this revision to Diff 40389.Nov 17 2015, 5:16 AM
zatrazz edited edge metadata.

Changes from previous version:

  • Fixed typos in variable definition;
  • Removed ClRuntimeShadowMaskValue option;
  • Removed IntTy definition;
  • Moved ExternalShadowMask initialization to runOnModules.
pcc accepted this revision.Nov 17 2015, 11:47 AM
pcc edited edge metadata.

LGTM with a test case.

This revision is now accepted and ready to land.Nov 17 2015, 11:47 AM
zatrazz updated this revision to Diff 40691.Nov 19 2015, 12:21 PM
zatrazz edited edge metadata.

What about this testcase?

zatrazz closed this revision.Nov 27 2015, 5:05 AM