]> git.itanic.dy.fi Git - linux-stable/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)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 18 Oct 2022 22:07:33 +0000 (15:07 -0700)
commit7c201739beef1a586d806463f1465429cdce34c5
treef9fd2248f429a09e357a848f5f4628b3abd547cb
parent9abf2313adc1ca1b6180c508c25f22f9395cc780
kcsan: Instrument memcpy/memset/memmove with newer Clang

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>
kernel/kcsan/core.c