aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/init
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-06-11 20:02:46 +0200
committerThomas Gleixner <tglx@linutronix.de>2020-06-11 20:02:46 +0200
commit37d1a04b13a6d2fec91a6813fc034947a27db034 (patch)
treec6a8d7d0df96a6eb1ddb53a12885761cb72e0e92 /init
parentlocking/atomics: Flip fallbacks and instrumentation (diff)
parentMerge branch 'kcsan-for-tip' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into locking/kcsan (diff)
downloadwireguard-linux-37d1a04b13a6d2fec91a6813fc034947a27db034.tar.xz
wireguard-linux-37d1a04b13a6d2fec91a6813fc034947a27db034.zip
Rebase locking/kcsan to locking/urgent
Merge the state of the locking kcsan branch before the read/write_once() and the atomics modifications got merged. Squash the fallout of the rebase on top of the read/write once and atomic fallback work into the merge. The history of the original branch is preserved in tag locking-kcsan-2020-06-02. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'init')
-rw-r--r--init/init_task.c10
-rw-r--r--init/main.c2
2 files changed, 12 insertions, 0 deletions
diff --git a/init/init_task.c b/init/init_task.c
index a90ac70cc515..15089d15010a 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -174,6 +174,16 @@ struct task_struct init_task
#ifdef CONFIG_KASAN
.kasan_depth = 1,
#endif
+#ifdef CONFIG_KCSAN
+ .kcsan_ctx = {
+ .disable_count = 0,
+ .atomic_next = 0,
+ .atomic_nest_count = 0,
+ .in_flat_atomic = false,
+ .access_mask = 0,
+ .scoped_accesses = {LIST_POISON1, NULL},
+ },
+#endif
#ifdef CONFIG_TRACE_IRQFLAGS
.softirqs_enabled = 1,
#endif
diff --git a/init/main.c b/init/main.c
index b59e09353881..0ead83e86b5a 100644
--- a/init/main.c
+++ b/init/main.c
@@ -95,6 +95,7 @@
#include <linux/rodata_test.h>
#include <linux/jump_label.h>
#include <linux/mem_encrypt.h>
+#include <linux/kcsan.h>
#include <asm/io.h>
#include <asm/bugs.h>
@@ -1036,6 +1037,7 @@ asmlinkage __visible void __init start_kernel(void)
acpi_subsystem_init();
arch_post_acpi_subsys_init();
sfi_init_late();
+ kcsan_init();
/* Do the rest non-__init'ed, we're now alive */
arch_call_rest_init();