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

Please remove these commented out lines

319
326

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

326

Why do we need to align these?

368

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

837

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
326

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.

326

Same as the above. Added comments.

368

Thank you.

837

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
1730

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