From: Marco Elver Date: Tue, 30 Nov 2021 11:44:28 +0000 (+0100) Subject: mm, kcsan: Enable barrier instrumentation X-Git-Tag: v6.6.17~8479^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d37d1fa0154ef3920ad1975aadc083cecdf81b3b;p=platform%2Fkernel%2Flinux-rpi.git mm, kcsan: Enable barrier instrumentation Some memory management calls imply memory barriers that are required to avoid false positives. For example, without the correct instrumentation, we could observe data races of the following variant: T0 | T1 ------------------------+------------------------ | *a = 42; ---+ | kfree(a); | | | | b = kmalloc(..); // b == a <-+ | *b = 42; // not a data race! | Therefore, instrument memory barriers in all allocator code currently not being instrumented in a default build. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney --- diff --git a/mm/Makefile b/mm/Makefile index d6c0042..7919cd7 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -15,6 +15,8 @@ KCSAN_SANITIZE_slab_common.o := n KCSAN_SANITIZE_slab.o := n KCSAN_SANITIZE_slub.o := n KCSAN_SANITIZE_page_alloc.o := n +# But enable explicit instrumentation for memory barriers. +KCSAN_INSTRUMENT_BARRIERS := y # These files are disabled because they produce non-interesting and/or # flaky coverage that is not a function of syscall inputs. E.g. slab is out of