This is an archive of the discontinued LLVM Phabricator instance.

[libc] Fix msan/asan memcpy reentrancy
ClosedPublic

Authored by gchatelet on Mar 30 2021, 7:58 AM.

Details

Summary

This is needed to prevent asan/msan instrumentation to redirect CopyBlock to __asan_memcpy (resp. __msan_memcpy).
These functions would then differ operation to memcpy which leads to reentrancy issues.

With this patch, memcpy is fully instrumented and covered by asan/msan.

If this turns out to be too expensive, instrumentation can be selectively or fully disabled through the use of the __attribute__((no_sanitize(address, memory))) annotation.

Diff Detail

Event Timeline

gchatelet created this revision.Mar 30 2021, 7:58 AM
gchatelet requested review of this revision.Mar 30 2021, 7:58 AM
sivachandra accepted this revision.Mar 30 2021, 8:14 AM
This revision is now accepted and ready to land.Mar 30 2021, 8:14 AM
This revision was landed with ongoing or failed builds.Mar 30 2021, 8:29 AM
This revision was automatically updated to reflect the committed changes.
libc/src/__support/sanitizer.h