]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit324b57e8ea38fbccf1fe76bc4670892fbacbe278
tree58c7bbf78b1024d905fa6966291773399a6166fa
parent7c51ec755bba0f4ad817a12a8244387005e4109f
kcsan: Instrument memcpy/memset/memmove with newer Clang

commit 13bf674208c711fdd4587c27bce530cc1ec33ec4 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