[libc-commits] [PATCH] D99598: [libc] Fix msan/asan memcpy reentrancy

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Mar 30 07:58:08 PDT 2021


gchatelet created this revision.
gchatelet added a reviewer: sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.
gchatelet requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99598

Files:
  libc/src/__support/CMakeLists.txt
  libc/src/__support/sanitizer.h
  libc/src/__support/sanitizer_annotations.h
  libc/src/string/memory_utils/memcpy_utils.h
  libc/utils/FPUtil/x86_64/FEnv.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99598.334169.patch
Type: text/x-patch
Size: 5417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210330/b332fd10/attachment.bin>


More information about the libc-commits mailing list