This is an archive of the discontinued LLVM Phabricator instance.

[ASan] Skip any instruction inserted by another instrumentation.
ClosedPublic

Authored by Enna1 on May 23 2022, 8:49 PM.

Details

Summary

Currently, we only check !nosanitize metadata for instruction passed to function getInterestingMemoryOperands() or instruction which is a cannot return callable instruction.
This patch add this check to any instruction.

E.g. ASan shouldn't instrument the instruction inserted by UBSan/pointer-overflow.

Diff Detail

Event Timeline

Enna1 created this revision.May 23 2022, 8:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 8:49 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
Enna1 published this revision for review.May 23 2022, 9:49 PM
Enna1 edited the summary of this revision. (Show Details)
Enna1 added reviewers: vitalybuka, dvyukov.
Enna1 added a subscriber: MTC.
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 9:50 PM

We need a test here as well

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
2735–2738

Shouldn't we skip any instruction with nosanitize?

Enna1 updated this revision to Diff 431621.May 24 2022, 2:30 AM

address review comments

Enna1 updated this revision to Diff 431888.May 24 2022, 11:24 PM

Update patch

Enna1 updated this revision to Diff 431891.May 24 2022, 11:45 PM
Enna1 retitled this revision from [ASan] Skip pointer comparison and subtraction inserted by another instrumentation. to [ASan] Skip any instruction inserted by another instrumentation..May 25 2022, 7:19 PM
Enna1 edited the summary of this revision. (Show Details)
Enna1 added a comment.May 25 2022, 7:23 PM

I think we can remove D126270 as parent revision, only add D126294 as parent revision, and land this patch regardless of D126270 ?

Enna1 added a comment.Jun 6 2022, 12:21 AM

Gentle ping

vitalybuka accepted this revision.Jun 6 2022, 11:29 AM
This revision is now accepted and ready to land.Jun 6 2022, 11:29 AM