This is an archive of the discontinued LLVM Phabricator instance.

[dfsan] Add origin ABI wrappers
ClosedPublic

Authored by stephan.yichao.zhao on Mar 17 2021, 9:26 AM.

Details

Summary

supported: dl_get_tls_static_info, calloc, clock_gettime,
dfsan_set_write_callback, dl_iterato_phdr, dlopen, memcpy,
memmove, memset, pread, read, strcat, strdup, strncpy

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

Diff Detail

Event Timeline

stephan.yichao.zhao requested review of this revision.Mar 17 2021, 9:26 AM
stephan.yichao.zhao created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2021, 9:26 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
morehouse added inline comments.Mar 18 2021, 10:12 AM
compiler-rt/test/dfsan/custom.cpp
225–232

Please remove these commented out lines

317
324

This is past the end of the buffer, which is only 12 bytes long.

324

Why do we need to align these?

370

strd is a pointer, not an array. We nee to use strlen.

839

sizeof doesn't work properly on non-arrays.

stephan.yichao.zhao marked 6 inline comments as done.Mar 18 2021, 11:00 AM
stephan.yichao.zhao added inline comments.
compiler-rt/test/dfsan/custom.cpp
324

This is because of the 4-byte aligned origin. This is the aligned up boundary to check if origins of dst were updated. We do not access the out-of-bound address.
added comments.

Also added comments at test_dfsan_set_write_callback.

324

Same as the above. Added comments.

370

Thank you.

839

Thank you.

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

updated

morehouse accepted this revision.Mar 18 2021, 11:31 AM
morehouse added inline comments.
compiler-rt/test/dfsan/custom.cpp
1736

Can we test strncpy now?

This revision is now accepted and ready to land.Mar 18 2021, 11:31 AM

turned on testing strncpy

stephan.yichao.zhao marked an inline comment as done.Mar 18 2021, 11:33 AM

turned on testing strncpy