Re: [PATCH v2] string: use __builtin_memcpy() in strlcpy/strlcat
From: Kees Cook
Date: Tue May 30 2023 - 19:11:09 EST
On Tue, 30 May 2023 10:39:11 +0200, Alexander Potapenko wrote:
> lib/string.c is built with -ffreestanding, which prevents the compiler
> from replacing certain functions with calls to their library versions.
>
> On the other hand, this also prevents Clang and GCC from instrumenting
> calls to memcpy() when building with KASAN, KCSAN or KMSAN:
> - KASAN normally replaces memcpy() with __asan_memcpy() with the
> additional cc-param,asan-kernel-mem-intrinsic-prefix=1;
> - KCSAN and KMSAN replace memcpy() with __tsan_memcpy() and
> __msan_memcpy() by default.
>
> [...]
Applied to for-next/hardening, thanks!
[1/1] string: use __builtin_memcpy() in strlcpy/strlcat
https://git.kernel.org/kees/c/cfe93c8c9a7a
--
Kees Cook