This is an archive of the discontinued LLVM Phabricator instance.

[DFSan] Add custom wrapper for pthread_join.
ClosedPublic

Authored by morehouse on Dec 10 2020, 9:00 AM.

Details

Summary

The wrapper clears shadow for retval.

Diff Detail

Event Timeline

morehouse requested review of this revision.Dec 10 2020, 9:00 AM
morehouse created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2020, 9:00 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
compiler-rt/test/dfsan/custom.cpp
800

Do we also check &cbrv is not changed?

morehouse marked an inline comment as done.Dec 10 2020, 12:24 PM
morehouse added inline comments.
compiler-rt/test/dfsan/custom.cpp
800

How would it change? It's on the stack.

compiler-rt/test/dfsan/custom.cpp
800

My question was confusing.

Since pthread_join takes "void **retval", do we also check *retval has zero shadow?

morehouse marked 2 inline comments as done.Dec 10 2020, 12:48 PM
morehouse added inline comments.
compiler-rt/test/dfsan/custom.cpp
800

Yes, it is checked by this line actually.
&cbrv == retval, therefore cbrv == *retval.

stephan.yichao.zhao added inline comments.
compiler-rt/test/dfsan/custom.cpp
800

Thank you for explaining this. We cannot test dfsan_read_label(&cbrv, sizeof(cbrv)) because *cbrv is actually 2.

This revision is now accepted and ready to land.Dec 10 2020, 1:03 PM
This revision was landed with ongoing or failed builds.Dec 10 2020, 1:41 PM
This revision was automatically updated to reflect the committed changes.
morehouse marked an inline comment as done.