summaryrefslogtreecommitdiff
path: root/include/linux/kcsan.h
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2021-11-30 14:44:11 +0300
committerPaul E. McKenney <paulmck@kernel.org>2021-12-10 03:42:26 +0300
commit9756f64c8f2d19c0029a5827bda8ac275302ec22 (patch)
tree8c3d8f3bb18b527d6da3b27ff899f9d6f1ae6b62 /include/linux/kcsan.h
parent71f8de7092cb2cf95e3f7055df139118d1445597 (diff)
downloadlinux-9756f64c8f2d19c0029a5827bda8ac275302ec22.tar.xz
kcsan: Avoid checking scoped accesses from nested contexts
Avoid checking scoped accesses from nested contexts (such as nested interrupts or in scheduler code) which share the same kcsan_ctx. This is to avoid detecting false positive races of accesses in the same thread with currently scoped accesses: consider setting up a watchpoint for a non-scoped (normal) access that also "conflicts" with a current scoped access. In a nested interrupt (or in the scheduler), which shares the same kcsan_ctx, we cannot check scoped accesses set up in the parent context -- simply ignore them in this case. With the introduction of kcsan_ctx::disable_scoped, we can also clean up kcsan_check_scoped_accesses()'s recursion guard, and do not need to modify the list's prev pointer. Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'include/linux/kcsan.h')
-rw-r--r--include/linux/kcsan.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kcsan.h b/include/linux/kcsan.h
index fc266ecb2a4d..13cef3458fed 100644
--- a/include/linux/kcsan.h
+++ b/include/linux/kcsan.h
@@ -21,6 +21,7 @@
*/
struct kcsan_ctx {
int disable_count; /* disable counter */
+ int disable_scoped; /* disable scoped access counter */
int atomic_next; /* number of following atomic ops */
/*