This is an archive of the discontinued LLVM Phabricator instance.

Extend the dfsan store/load callback with write/read address
ClosedPublic

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

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptNov 10 2020, 11:08 PM
stephan.yichao.zhao requested review of this revision.Nov 10 2020, 11:08 PM

Please also update the event_callbacks.c test.

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

Please update this comment.

370

Rather than diverging loads/stores, can we also add the address to the load callback?

1482–1484

Let's reuse the Int8Ptr member variable.

llvm/test/Instrumentation/DataFlowSanitizer/callback.ll
7

The variable numbers in this test seem potentially brittle. Can we avoid matching against them?

stephan.yichao.zhao marked an inline comment as done.

update

stephan.yichao.zhao marked 2 inline comments as done.Nov 11 2020, 1:30 PM
stephan.yichao.zhao added inline comments.
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
1482–1484

That one is defined in DataFlowSanitizer.

stephan.yichao.zhao retitled this revision from Extend the dfsan store callback with write address to Extend the dfsan store/load callback with write/read address.Nov 11 2020, 1:30 PM
morehouse added inline comments.Nov 12 2020, 6:15 AM
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
173

Should it be const void* instead?

1482–1484

Yes let's use it.

llvm/test/Instrumentation/DataFlowSanitizer/callback.ll
7

All the other ones too. Look at the other tests in this directory. They avoid specifying variable numbers since those can easily change.

stephan.yichao.zhao marked an inline comment as done.

update

stephan.yichao.zhao marked 2 inline comments as done.Nov 12 2020, 11:59 AM
stephan.yichao.zhao added inline comments.
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
1482–1484

Done. Sorry. I did not realize DFSF is a struct, so all members are public.

llvm/test/Instrumentation/DataFlowSanitizer/callback.ll
7

replaced by regex.

morehouse added inline comments.Nov 12 2020, 3:38 PM
llvm/test/Instrumentation/DataFlowSanitizer/callback.ll
16
stephan.yichao.zhao marked 2 inline comments as done.

update

stephan.yichao.zhao marked an inline comment as done.Nov 12 2020, 3:42 PM
stephan.yichao.zhao added inline comments.
llvm/test/Instrumentation/DataFlowSanitizer/callback.ll
16

Done. Thank you.

This revision is now accepted and ready to land.Nov 12 2020, 3:49 PM
stephan.yichao.zhao marked 2 inline comments as done.Nov 13 2020, 11:41 AM
This revision was landed with ongoing or failed builds.Nov 13 2020, 11:48 AM
This revision was automatically updated to reflect the committed changes.