Page MenuHomePhabricator

[MSAN] Instrument freeze instruction by clearing shadow
ClosedPublic

Authored by guiand on Jul 31 2020, 11:55 AM.

Details

Summary
Freeze always returns a defined value. This also prevents msan from
checking the input shadow, which happened because freeze wasn't
explicitly visited.

Diff Detail

Event Timeline

guiand created this revision.Jul 31 2020, 11:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2020, 11:55 AM
guiand requested review of this revision.Jul 31 2020, 11:55 AM
eugenis added inline comments.Jul 31 2020, 1:08 PM
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
4071

This does not override anything (try visitFreezeInst).

4073

Need setOrigin, too.

llvm/test/Instrumentation/MemorySanitizer/freeze.ll
19

This test is passing at ToT.

Oh! I need to test that it's not checked as well.

guiand updated this revision to Diff 282337.Jul 31 2020, 3:37 PM

Fixed to actually set the shadow and origin. Sorry for the mix-up!

guiand marked 2 inline comments as done.Jul 31 2020, 3:38 PM

Oh, wait, the patch didn't update. One sec.

guiand updated this revision to Diff 282338.Jul 31 2020, 3:38 PM

Updated.

guiand marked an inline comment as done.Jul 31 2020, 3:38 PM
eugenis accepted this revision.Jul 31 2020, 3:42 PM

LGTM

This revision is now accepted and ready to land.Jul 31 2020, 3:42 PM
This revision was automatically updated to reflect the committed changes.