mm/vma: introduce VM_ACCESS_FLAGS
[linux-2.6-microblaze.git] / mm / kasan / report.c
index cf5c17d..80f23c9 100644 (file)
@@ -92,8 +92,16 @@ static void end_report(unsigned long *flags)
        pr_err("==================================================================\n");
        add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
        spin_unlock_irqrestore(&report_lock, *flags);
-       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");
+       }
        kasan_enable_current();
 }