This is an archive of the discontinued LLVM Phabricator instance.

[dfsan] Tracking origins at memory transfer
ClosedPublic

Authored by stephan.yichao.zhao on Mar 8 2021, 9:14 AM.

Diff Detail

Event Timeline

stephan.yichao.zhao requested review of this revision.Mar 8 2021, 9:15 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 8 2021, 9:15 AM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
morehouse added inline comments.Mar 8 2021, 10:41 AM
compiler-rt/test/dfsan/origin_memcpy.c
20

Why don't we get an origin saved for these stores?

35

Currently the test triggers read of uninitialized memory, but that isn't necessary for this test. So let's initialize these two variables here.

compiler-rt/test/dfsan/origin_unaligned_memtrans.c
45

This test seems to cover all the cases from origin_memmove.c and origin_memcpy.c. Do we still need those?

initialized variables
added missing stacks for fn_g

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

made origin_memmove.c use aligned addresses

stephan.yichao.zhao marked an inline comment as done.Mar 8 2021, 11:40 AM
stephan.yichao.zhao added inline comments.
compiler-rt/test/dfsan/origin_memcpy.c
20

Thank you for catching this. Added the missing tracks in the 3 test cases.

compiler-rt/test/dfsan/origin_unaligned_memtrans.c
45

Updated origin_memmove.cc to use aligned addresses.
Then this file focuses on unaligned addresses.

This revision is now accepted and ready to land.Mar 8 2021, 4:05 PM