@@ -492,8 +492,16 @@ static void print_report(enum kcsan_value_change value_change,
dump_stack_print_info(KERN_DEFAULT);
pr_err("==================================================================\n");
- if (panic_on_warn)
+ if (panic_on_warn) {
+ /*
+ * This thread may hit another WARN() in the panic path.
+ * Resetting this prevents additional WARN() from panicking the
+ * system on this thread. Other threads are blocked by the
+ * panic_mutex in panic().
+ */
+ panic_on_warn = 0;
panic("panic_on_warn set ...\n");
+ }
}
static void release_report(unsigned long *flags, struct other_info *other_info)
As done in the full WARN() handler, panic_on_warn needs to be cleared before calling panic() to avoid recursive panics. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> --- kernel/kcsan/report.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)