This is an archive of the discontinued LLVM Phabricator instance.

[asan] Fix size/alignment issues with non-default shadow scale
ClosedPublic

Authored by waltl on Oct 31 2017, 1:57 PM.

Details

Summary

Fix a couple places where the minimum alignment/size should be a
function of the shadow granularity:

  • alignment of AllGlobals
  • the minimum left redzone size on the stack

Added a test to verify that the metadata_array is properly aligned
for shadow scale of 5, to be enabled when we add build support
for testing shadow scale of 5.

Event Timeline

waltl created this revision.Oct 31 2017, 1:57 PM
kosarev added a subscriber: kosarev.Nov 1 2017, 1:38 AM
waltl updated this revision to Diff 122002.Nov 7 2017, 3:42 PM

Miscellaneous cleanups.

vitalybuka accepted this revision.Nov 10 2017, 10:33 AM
This revision is now accepted and ready to land.Nov 10 2017, 10:33 AM

oh, could you please extend some test to cover this case?

vitalybuka requested changes to this revision.Nov 10 2017, 10:34 AM
This revision now requires changes to proceed.Nov 10 2017, 10:34 AM
waltl updated this revision to Diff 122691.Nov 13 2017, 11:00 AM
waltl edited edge metadata.

Add test to verify metadata_array alignment

waltl edited the summary of this revision. (Show Details)Nov 13 2017, 11:02 AM

oh, could you please extend some test to cover this case?

Done.

vitalybuka requested changes to this revision.Nov 15 2017, 3:08 PM

Done.

Not sure how the recent patch tests --asan-mapping-scale=5

New tests could be additional "// RUN: opt... --asan-mapping-scale=5", with new CHECK prefixes
or just new files, maybe copied from existing tests. Potential candidates: instrument-stack.ll, adaptive_global_redzones.ll

This revision now requires changes to proceed.Nov 15 2017, 3:08 PM
waltl added a comment.Nov 15 2017, 3:27 PM

Not sure how the recent patch tests --asan-mapping-scale=5

New tests could be additional "// RUN: opt... --asan-mapping-scale=5", with new CHECK prefixes
or just new files, maybe copied from existing tests. Potential candidates: instrument-stack.ll, adaptive_global_redzones.ll

Yes this patch doesn't test -asan-mapping-scale=5. That testing is added in https://reviews.llvm.org/D39775. Most of the instrumentation tests directly under llvm/test/Instrumentation/AddressSanitizer will be enabled for shadow scale 5, including the ones that you mentioned.

The most recent change here adds a test to verify that the metadata_array is properly aligned for shadow scale 5, and it will be automatically enabled once https://reviews.llvm.org/D39775 is submitted.

waltl edited the summary of this revision. (Show Details)Nov 15 2017, 3:29 PM
vitalybuka accepted this revision.Nov 15 2017, 4:24 PM
This revision is now accepted and ready to land.Nov 15 2017, 4:24 PM
This revision was automatically updated to reflect the committed changes.