mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-kasan-do-not-panic-if-both-panic_on_warn-and-kasan_multishot-set.patch added to -mm tree
@ 2020-09-12 20:02 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-09-12 20:02 UTC (permalink / raw)
  To: mm-commits, vincent.guittot, trishalfonso, shuah, mingo,
	juri.lelli, dvyukov, brendanhiggins, aryabinin, a.p.zijlstra,
	andreyknvl, davidgow


The patch titled
     Subject: mm: kasan: do not panic if both panic_on_warn and kasan_multishot set
has been added to the -mm tree.  Its filename is
     mm-kasan-do-not-panic-if-both-panic_on_warn-and-kasan_multishot-set.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-kasan-do-not-panic-if-both-panic_on_warn-and-kasan_multishot-set.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-kasan-do-not-panic-if-both-panic_on_warn-and-kasan_multishot-set.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: David Gow <davidgow@google.com>
Subject: mm: kasan: do not panic if both panic_on_warn and kasan_multishot set

KASAN errors will currently trigger a panic when panic_on_warn is set. 
This renders kasan_multishot useless, as further KASAN errors won't be
reported if the kernel has already paniced.  By making kasan_multishot
disable this behaviour for KASAN errors, we can still have the benefits of
panic_on_warn for non-KASAN warnings, yet be able to use kasan_multishot.

This is particularly important when running KASAN tests, which need to
trigger multiple KASAN errors: previously these would panic the system if
panic_on_warn was set, now they can run (and will panic the system should
non-KASAN warnings show up).

Link: https://lkml.kernel.org/r/20200910070331.3358048-6-davidgow@google.com
Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Patricia Alfonso <trishalfonso@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/kasan/report.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/kasan/report.c~mm-kasan-do-not-panic-if-both-panic_on_warn-and-kasan_multishot-set
+++ a/mm/kasan/report.c
@@ -95,7 +95,7 @@ static void end_report(unsigned long *fl
 	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 && !test_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags)) {
 		/*
 		 * This thread may hit another WARN() in the panic path.
 		 * Resetting this prevents additional WARN() from panicking the
_

Patches currently in -mm which might be from davidgow@google.com are

mm-kasan-do-not-panic-if-both-panic_on_warn-and-kasan_multishot-set.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-12 20:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-12 20:02 + mm-kasan-do-not-panic-if-both-panic_on_warn-and-kasan_multishot-set.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).