Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp270561ybz; Tue, 21 Apr 2020 08:43:33 -0700 (PDT) X-Google-Smtp-Source: APiQypJqvPHRdNWr5Y0PfyBNqbDX5tket7Ww5k1F13jFs8MN0p1erOAq80nClU4CqBIq2qNu/1TK X-Received: by 2002:a17:906:2ad4:: with SMTP id m20mr22850723eje.324.1587483812793; Tue, 21 Apr 2020 08:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587483812; cv=none; d=google.com; s=arc-20160816; b=DKYNE78ZcbqK2D3u6zyMgkM6oouPPb7M8pmSab76xbIPZKzh4geMhrGfHM6IaC7BrI RK6r5lTPY/AhJXGz1ULslvttPaoAHg/72DLrWs1USIKGXbiartCnGf4CL7W/XvFnzw0X 8shNqFrJilkPrtXTUMBz/pxKaCnPAxaaQhejtk1fDmkAWZIFdydFPGoODrZ0NxSEkbhS BOTi7Ag944cycoAYvQfIO6fqG4yvzkLVdw8KR3IqtkQr7RP69lLFuN7NSfFRwieLOyUQ N3N2r7y8HcL/3XUYLVW6GSMGrI9JC+NsL3EvTxQWOup3cHj1M+Ls8t7UowBBkfBbMgIi jboQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2mmoGh7NbU2I6i6mTnfpxZZ+azD3XtCswEGTNXCLuyA=; b=pjBHCEY0beQvfUClQBpPpR3NtMAQfWNQc8DMjIlwj/1Oy5JXBXRa8JqQssav8i8+FT T/ZvTwDh25hT4q4blbKA7C53XzRPydf4Z2zISJEGtMBfnKwQwDGC9ZvkjOQsOFYictQZ sKfwrL0DvM7H6I3PL5oUZS4nprU9uQFEIB5N7lUMIiQK6FurqU1gluXPiwkNNTbnoKZ6 4RXDByVFVC01uNl21BTgwm2RC4dYzKkTStouUGwHmtmy90hlRyfZB334HPMokD9PFpjL Q7dUKfVNgI2nnavw/TViKL91ynxX2/Z+bgIW5zLQYJX8kDAKd9NTNm+xtAVUWJw4thZc B+Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QGgo4tZ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv10si1496212ejb.519.2020.04.21.08.43.08; Tue, 21 Apr 2020 08:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QGgo4tZ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727816AbgDUPjm (ORCPT + 99 others); Tue, 21 Apr 2020 11:39:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725613AbgDUPjk (ORCPT ); Tue, 21 Apr 2020 11:39:40 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D08E6C061A41 for ; Tue, 21 Apr 2020 08:39:39 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id hi11so1485644pjb.3 for ; Tue, 21 Apr 2020 08:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2mmoGh7NbU2I6i6mTnfpxZZ+azD3XtCswEGTNXCLuyA=; b=QGgo4tZ7skjSV+mL+s3apHVRj1cNzDRfziKAXEk/Ph5dhpMbSxC6LSaVrBDyOosNOK STKijhMpCZRlfYKcDyKnjKpDuEHgukjsG9QksyLsh5tsPHAPKnt4bap11a7mmVPNCeHk kuWjNX41klD3xtfSylSX8LTC+fZOmuDBCrXcPO4f4CdRE/jS7WJ/cp39nzoEn7PUccHx TrpoAUzxh06+NnuC5LnWIpvkQlA7I/fkXcnLdtOil2mnUCUohVyB1FYcc6g+yFf8C4Qe 1yuzm/rPeZYK0RCv0VwfkhwwK0vPV6pAkaCnEBAAl71uN+PquwZPGfK3Bljp7QkApEUm 4MJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2mmoGh7NbU2I6i6mTnfpxZZ+azD3XtCswEGTNXCLuyA=; b=BlINY/8yVaK9VMwGlPs9B4OQttxgcrK84Re1tzLsbd8CWjH9rWcFpdXdd9huSX8LJ3 bUV7WpWZJBdITfVLS2xzk9sKrt8QfCz+RdDiSCAAZlt+6h/9Jfpv7gbDy57Eg53L2Y+9 KyL4Uq8DXaXjNJ0JzoPgFah1qTfp/7WOnX7HUrfyfTzfOAIlmd/Jjl1gyj2JpG/yRM2I iOGHjgPDWjtY6i+3K3wNEevTO8C+x2YWIO26OYWLqf/sZMvFLw4qwvsYi7Me4VHBNsj2 CgxIl47oGseTGkaVFoQQW6R+tODLo2m7+191sE7CK3S5rS+V1coVCjDSlISqY8C9pxiC uuiQ== X-Gm-Message-State: AGi0PuY2b9oEKyyamq5zXownTNCzUdVk5DOKTOerEB0kMKzRdrhjpLtO GAtjwd5gDVnAiNJvWadb6fn6uyq120OhN0NzFBzwfA== X-Received: by 2002:a17:90a:8c93:: with SMTP id b19mr6142175pjo.90.1587483579220; Tue, 21 Apr 2020 08:39:39 -0700 (PDT) MIME-Version: 1.0 References: <20200418031833.234942-1-davidgow@google.com> <20200418031833.234942-6-davidgow@google.com> In-Reply-To: <20200418031833.234942-6-davidgow@google.com> From: Andrey Konovalov Date: Tue, 21 Apr 2020 17:39:28 +0200 Message-ID: Subject: Re: [PATCH v6 5/5] mm: kasan: Do not panic if both panic_on_warn and kasan_multishot set To: David Gow Cc: Patricia Alfonso , Brendan Higgins , Andrey Ryabinin , Dmitry Vyukov , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , LKML , kasan-dev , kunit-dev@googlegroups.com, "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 18, 2020 at 5:19 AM 'David Gow' via kasan-dev wrote: > > 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). > > Signed-off-by: David Gow Reviewed-by: Andrey Konovalov > --- > mm/kasan/report.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/kasan/report.c b/mm/kasan/report.c > index 0c206bbf9cb3..79fe23bd4f60 100644 > --- a/mm/kasan/report.c > +++ b/mm/kasan/report.c > @@ -94,7 +94,7 @@ 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 && !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 > -- > 2.26.1.301.g55bc3eb7cb9-goog > > -- > You received this message because you are subscribed to the Google Groups "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/20200418031833.234942-6-davidgow%40google.com.