This is an archive of the discontinued LLVM Phabricator instance.

[dfsan] Add a flag to control whether to propagate labels from condition values to results
ClosedPublic

Authored by stephan.yichao.zhao on Nov 10 2020, 10:14 PM.

Details

Summary

Before the change, DFSan always does the propagation. W/o
origin tracking, it is harder to understand such flows. After
the change, the flag is off by default.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptNov 10 2020, 10:14 PM
stephan.yichao.zhao requested review of this revision.Nov 10 2020, 10:14 PM
morehouse added inline comments.Nov 11 2020, 7:23 AM
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
191

It only applies to selects, so maybe we should name it something like dfsan-track-select-control-flow. and update the description/comment.

193

This changes the default behavior. Does it cause any existing tests to fail?

Maybe we should default it to true.

llvm/test/Instrumentation/DataFlowSanitizer/select.ll
51

I think this tests the same case as select8. If we want to test the vector one, we need %c to be a vector.

lebedev.ri retitled this revision from Add a flag to control whether to propagate labels from condition values to results to [dfsan] Add a flag to control whether to propagate labels from condition values to results.Nov 11 2020, 7:27 AM

addressed comments

stephan.yichao.zhao marked 3 inline comments as done.Nov 11 2020, 11:17 AM
This revision is now accepted and ready to land.Nov 11 2020, 11:36 AM