This is an archive of the discontinued LLVM Phabricator instance.

[dfsan] Propagate origins for callsites
ClosedPublic

Authored by stephan.yichao.zhao on Feb 25 2021, 9:12 AM.

Details

Summary

This is a part of https://reviews.llvm.org/D95835.

Each customized function has two wrappers. The
first one dfsw is for the normal shadow propagation. The second one dfso is used
when origin tracking is on. It calls the first one, and does additional
origin propagation. Which one to use can be decided at instrumentation
time. This is to ensure minimal additional overhead when origin tracking
is off.

Diff Detail

Event Timeline

stephan.yichao.zhao requested review of this revision.Feb 25 2021, 9:12 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 25 2021, 9:12 AM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
morehouse accepted this revision.Feb 26 2021, 7:45 AM
morehouse added inline comments.
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
706

Aside: We call this function a lot. Maybe we should just set a bool during initialization and use that instead.

2621

Nit: This function is already huge. Is there a clean way to move this new logic into a helper function, and maybe share some of the similar logic with the shadow args above?

This revision is now accepted and ready to land.Feb 26 2021, 7:45 AM
stephan.yichao.zhao marked 2 inline comments as done.Feb 26 2021, 10:16 AM
stephan.yichao.zhao added inline comments.
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
706

Added a static bool inside shouldTrackOrigins to catch the result.

2621

Added addShadowArguments and addOriginArguments. I should have refactored them before this change.

stephan.yichao.zhao marked 2 inline comments as done.

addressed comments; fixed lint

This revision was landed with ongoing or failed builds.Feb 26 2021, 11:13 AM
This revision was automatically updated to reflect the committed changes.