Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp179444ybl; Tue, 20 Aug 2019 17:54:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVqk89Nb+b7jcMk6Qx29WLFq3WwEYtx9OyYvLCM0885cnYCo+D5qicWqNBV5U3o7LreA0A X-Received: by 2002:a17:902:f64:: with SMTP id 91mr409360ply.334.1566348896222; Tue, 20 Aug 2019 17:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566348896; cv=none; d=google.com; s=arc-20160816; b=XRuHIcPYLwYMXGrY5urNqEe7AyqyxngedqbVbWZB9h0NpgXhBNRWHKSo6agX/n3rwd 5Yr7cRiEwDaNUwXM2meFJzatE7zvafHAtqV9NA96XkzsK05RTI1NHG0WyzqjrIyyjgzb wPE710kLQtnhNKXbvlit5Yfi1miRjOXB5Rhekh2LSNrasH47zCH49AaYNTH2GAiMgT29 t77PSZ0ZWXi5enju4jBxymANadMjitDnSjPqjjqyRkAG+7+iNYi1NFwvHf0+nqHWwFWq aP35YHg1UOoSmS1Cq7/YjWSSUG9jN/qUibFSR2URM30KwdVh7Da+vtLEk/v5y+BiS/u9 eQtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=2daHLGsthc9xU5IzXwvDqKEzAYvnRpmqPadPm2sI9Is=; b=QsSNLxHcaG7KBXjcTK2hg46CdeJcL+S0ObNZ5rSt9QMmL8a7U0Gz5idn/5+7jCEUYp pOKcWL6XdslQqb7iYZ5cGBsoM+ZZnjHiMlfR6YX/biSek+yHriKP8t+ez6Xjg/29d0BA 525OzmTulIASXvbHhTLEnPDT9tub3r8+tmnhNHBLnGKd8xQM9fpGhflS8SofhAWkboO1 70ncHNtHEhk+VId03su+DaohkETJz7UTzOTiD7ezCji1zv5a297LjYaAX0gYMqgoBYP3 pfANhRM+PjPZG0ZvT9bI6+LT5Oy/wUlsT0g8o6ShSMJz+M7MplYvJTduxq4kTmwpLY6L n0oQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si13028669pfo.30.2019.08.20.17.54.40; Tue, 20 Aug 2019 17:54:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726730AbfHUAu2 (ORCPT + 99 others); Tue, 20 Aug 2019 20:50:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:60296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfHUAu1 (ORCPT ); Tue, 20 Aug 2019 20:50:27 -0400 Received: from oasis.local.home (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 542C3206BB; Wed, 21 Aug 2019 00:50:26 +0000 (UTC) Date: Tue, 20 Aug 2019 20:50:20 -0400 From: Steven Rostedt To: Kees Cook Cc: Christophe Leroy , Peter Zijlstra , Andrew Morton , Drew Davenport , Arnd Bergmann , Feng Tang , Petr Mladek , Mauro Carvalho Chehab , Borislav Petkov , YueHaibing , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 7/7] bug: Move WARN_ON() "cut here" into exception handler Message-ID: <20190820205020.1fc22706@oasis.local.home> In-Reply-To: <201908200908.6437DF5@keescook> References: <20190819234111.9019-1-keescook@chromium.org> <20190819234111.9019-8-keescook@chromium.org> <20190820100638.GK2332@hirez.programming.kicks-ass.net> <06ba33fd-27cc-3816-1cdf-70616b1782dd@c-s.fr> <201908200908.6437DF5@keescook> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Aug 2019 09:33:24 -0700 Kees Cook wrote: > > > > diff --git a/lib/bug.c b/lib/bug.c > > > > index 1077366f496b..6c22e8a6f9de 100644 > > > > --- a/lib/bug.c > > > > +++ b/lib/bug.c > > > > @@ -181,6 +181,15 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) > > > > } > > > > } > > > > + /* > > > > + * BUG() and WARN_ON() families don't print a custom debug message > > > > + * before triggering the exception handler, so we must add the > > > > + * "cut here" line now. WARN() issues its own "cut here" before the > > > > + * extra debugging message it writes before triggering the handler. > > > > + */ > > > > + if ((bug->flags & BUGFLAG_PRINTK) == 0) > > > > + printk(KERN_DEFAULT CUT_HERE); > > > > > > I'm not loving that BUGFLAG_PRINTK name, BUGFLAG_CUT_HERE makes more > > > sense to me. > > That's fine -- easy rename. :) > > > Actually it would be BUGFLAG_NO_CUT_HERE then, otherwise all arches not > > using the generic macros will have to add the flag to get the "cut here" > > line. > > I am testing for the lack of the flag (so that only the > CONFIG_GENERIC_BUG with __WARN_FLAGS case needs to set it). I was > thinking of the flag to mean "this reporting flow has already issued > cut-here". It sounds like it would be more logical to have it named > BUGFLAG_NO_CUT_HERE to mean "do not issue a cut-here; it has already > happened"? I will update the patch. > BUGFLAG_HAS_CUT_HERE ? As it shows it was already done? -- Steve