kcsan: Instrument memcpy/memset/memmove with newer Clang
authorMarco Elver <elver@google.com>
Mon, 12 Sep 2022 09:45:40 +0000 (11:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 10:29:02 +0000 (11:29 +0100)
commit6a0ef7326e1e7dcb37d797dd77335cc145cad149
tree58c7bbf78b1024d905fa6966291773399a6166fa
parentc9ded831e2552b9c3cab7e2591a190e94f9d29c0
kcsan: Instrument memcpy/memset/memmove with newer Clang

commit 7c201739beef1a586d806463f1465429cdce34c5 upstream.

With Clang version 16+, -fsanitize=thread will turn
memcpy/memset/memmove calls in instrumented functions into
__tsan_memcpy/__tsan_memset/__tsan_memmove calls respectively.

Add these functions to the core KCSAN runtime, so that we (a) catch data
races with mem* functions, and (b) won't run into linker errors with
such newer compilers.

Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/kcsan/core.c