This is an archive of the discontinued LLVM Phabricator instance.

[dfsan] Instrument origin variable and function definitions
ClosedPublic

Authored by stephan.yichao.zhao on Feb 18 2021, 10:32 AM.

Diff Detail

Unit TestsFailed

Event Timeline

stephan.yichao.zhao requested review of this revision.Feb 18 2021, 10:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 10:32 AM
stephan.yichao.zhao added a subscriber: Restricted Project.Feb 18 2021, 10:32 AM
morehouse added inline comments.Feb 18 2021, 2:41 PM
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
482

Can this be constant instead of a function?

llvm/test/Instrumentation/DataFlowSanitizer/basic.ll
11

IIRC, even with --check-prefix, the CHECK lines are still verified. So don't we get a failure for the line above this one (track_origins = 0)?

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

update

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
482

Thank you. Replaced by kNumOfElementsInArgOrgTLS;

llvm/test/Instrumentation/DataFlowSanitizer/basic.ll
11

Hm, I found FileCheck ignores CHECK if --check-prefix is used.
But the problem is that we may want to rename the last one with prefix CHECK_NO_ORIGIN.

Updated.

gbalats added inline comments.Feb 18 2021, 3:01 PM
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
335

Is this tied to ShadowWidthBits? With fast8, how would this change?

llvm/test/Instrumentation/DataFlowSanitizer/basic.ll
2–3

You could use --check-prefixes to merge these.

morehouse accepted this revision.Feb 18 2021, 3:03 PM
morehouse added inline comments.
llvm/test/Instrumentation/DataFlowSanitizer/basic.ll
2–3
11

Interesting, I guess I've been doing it wrong then. Thanks for informing!

This revision is now accepted and ready to land.Feb 18 2021, 3:03 PM
stephan.yichao.zhao marked 3 inline comments as done.

replaced by --check-prefixes

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
335

Origin tracking always uses 4-byte.
Every 4 user byte shares one 4-byte origin. So its memory overhead is always 1x.

Origin is like a hash value, 32bit gives us enough hash space.
It would not be changed in 8-bit mode.

llvm/test/Instrumentation/DataFlowSanitizer/basic.ll
2–3

Done. Thank you.

2–3

Thank you. The two comments match exactly. :)

This revision was landed with ongoing or failed builds.Feb 18 2021, 3:50 PM
This revision was automatically updated to reflect the committed changes.
Harbormaster completed remote builds in B89807: Diff 324782.