kernel_optimize_test/kernel/kcsan
Marco Elver d591ec3db7 kcsan: Introduce KCSAN_ACCESS_ASSERT access type
The KCSAN_ACCESS_ASSERT access type may be used to introduce dummy reads
and writes to assert certain properties of concurrent code, where bugs
could not be detected as normal data races.

For example, a variable that is only meant to be written by a single
CPU, but may be read (without locking) by other CPUs must still be
marked properly to avoid data races. However, concurrent writes,
regardless if WRITE_ONCE() or not, would be a bug. Using
kcsan_check_access(&x, sizeof(x), KCSAN_ACCESS_ASSERT) would allow
catching such bugs.

To support KCSAN_ACCESS_ASSERT the following notable changes were made:

  * If an access is of type KCSAN_ASSERT_ACCESS, disable various filters
    that only apply to data races, so that all races that KCSAN observes are
    reported.
  * Bug reports that involve an ASSERT access type will be reported as
    "KCSAN: assert: race in ..." instead of "data-race"; this will help
    more easily distinguish them.
  * Update a few comments to just mention 'races' where we do not always
    mean pure data races.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2020-03-21 09:42:50 +01:00
..
atomic.h kcsan: Prefer __always_inline for fast-path 2020-03-21 09:40:19 +01:00
core.c kcsan: Introduce KCSAN_ACCESS_ASSERT access type 2020-03-21 09:42:50 +01:00
debugfs.c kcsan: Introduce KCSAN_ACCESS_ASSERT access type 2020-03-21 09:42:50 +01:00
encoding.h kcsan: Prefer __always_inline for fast-path 2020-03-21 09:40:19 +01:00
kcsan.h kcsan: Introduce KCSAN_ACCESS_ASSERT access type 2020-03-21 09:42:50 +01:00
Makefile kcsan, ubsan: Make KCSAN+UBSAN work together 2020-01-07 07:47:23 -08:00
report.c kcsan: Introduce KCSAN_ACCESS_ASSERT access type 2020-03-21 09:42:50 +01:00
test.c kcsan: Fix 0-sized checks 2020-03-21 09:42:42 +01:00