Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5507712ybe; Tue, 10 Sep 2019 05:00:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwShi9qlK9ALAvf3dVtJsGfnKA/hegG2kfNiJbBtIwrrrr1o/X39RjkC6PcK9ln5choRz+G X-Received: by 2002:aa7:d5cb:: with SMTP id d11mr30489295eds.250.1568116800342; Tue, 10 Sep 2019 05:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568116800; cv=none; d=google.com; s=arc-20160816; b=XGEqdk4YUJ5ARAdY9QTYDWH/OBvuQ/fhre1puBCKwxndj8Thb3nBv9Ye3D6e1eE5r5 QwhBhH9GwVqzQf8eNaIMGCah3MoWajSZfPjC2VgGMmfSRGN0UxrR/Nb6W54B9Qk1m5o4 l0JbJS5G7SIdICu7Snse9oZd8a4Ps5DbPCNlGS2Ye8SlFaaHhcHZZJHQEnavtARH77jp m/UG9pg4pYFpe9E9n1IO5QdK0A1S/29Fi1vvDRHs9T3kCref1n8uI4LjRQcnVzrLvp+B zhqd55agarpFWmiqu+XWxnxfWFPYLKdgdHTg94xElicSW7jFaWQ5tqS6Z+5pIRlF0khm ToTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wfhBlXbTlTMX4E76VadOfA+hOSSFiVKlUr5WhybwN6Y=; b=hhGoJn964KJDVzdon1ZlEz8DKrsiZXM7B+kIEUKld15w4bw9mf81ogCThj6O2qYVWU rtt0PWSiuA3MXbLNgm/MKiD4V4sjCRkDOJBz9zZJD9G8+U7oD/QF6cjU5REVHZKnCMWU zZQpXf0SZQEGpSRnIYwl1ozKqWE2r5kD4pAuLMUTzV9yYvEKDPJIwPJFoG/w7QkRYMtE bnWWEMYkxbCnYwH7WHRBpjao/34lGf846kIs963drbFHC5z+pIG7gJGNIXtWo1wZeiD6 VlHI/h+2KuPcZYnoFXT7cUi4rj5dk9vIPOl1FBSw0i4kdcUrPBH/GW2bSoWAr11/4Ya6 EmdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ix5XIq52; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d26si8971811ejb.12.2019.09.10.04.59.36; Tue, 10 Sep 2019 05:00:00 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ix5XIq52; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729005AbfIJJQY (ORCPT + 99 others); Tue, 10 Sep 2019 05:16:24 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34529 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbfIJJQY (ORCPT ); Tue, 10 Sep 2019 05:16:24 -0400 Received: by mail-pf1-f196.google.com with SMTP id r12so11207653pfh.1; Tue, 10 Sep 2019 02:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wfhBlXbTlTMX4E76VadOfA+hOSSFiVKlUr5WhybwN6Y=; b=Ix5XIq52ojuczz2WFlndYuPyvegA1xBDLqKlQinxNi/ddwwT7aSp4BE52bdpTtvBZU VGccYwG2QB+jUEvkPdfe009RtiB9HEycmrhIrWHM2Wz5mmZhS9Z/AETPcWfTFmwV3RVr LmnHyXpoIlqloJ3oDoCuKVs3wIKH02w1f1IqNKPq+VKN2iVFQ8lY97MeHbb7nlrdDQjZ a1vYuEugpJMWHAut3i/uQueEv43jrugOrhortyg2TB6eWDbzer1PjupJpjCNdPR/GRIV TFhVK+cu/PfSgVeGkWYqYzXVF/xBJikC6YUBWbu1BJHOGROPTjsqrh8eNAkwfDzk1T8t KXbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wfhBlXbTlTMX4E76VadOfA+hOSSFiVKlUr5WhybwN6Y=; b=qVutd7aMe3kzHOynRAvUyp4RXnsCk2k13NO3v7MXVegLU8M6bx0N3nR9VoHjhYUK9e AOGSi3eLE2vAzf63NM+x/sbZOW3eAlgdN7kog1wlih/hUh4UE2y1g84jyym+Ijfvw1wQ fGyYk4Mw6Einaj4JDuSVT1WR/6puoUWSaMktOqSY8kMl+/Oj5UJBP6Q2xGDCrI57rfSL u432VeCwExz8H/6mz13zoAm85xn7oOcsT+xDAohmFkd/BpbqUUG3TsM4FH6oXCNzG9u2 E09j/PBgRRl78/selUIcSG9j64Q2p4RvcDCdRhE9KzkHcYben3gP6Pe6VAKuThCNX9V7 SN6g== X-Gm-Message-State: APjAAAWK5rtNKzRmOxqg2YZskMw+NokgPEd65l+V1hmNMgU0bGrfVhQ/ z5ylOapIXRh/4Ux6+PExiMzf3DwF X-Received: by 2002:a65:5cca:: with SMTP id b10mr27422854pgt.365.1568106983856; Tue, 10 Sep 2019 02:16:23 -0700 (PDT) Received: from localhost ([39.7.19.227]) by smtp.gmail.com with ESMTPSA id l26sm20389698pgb.90.2019.09.10.02.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 02:16:23 -0700 (PDT) Date: Tue, 10 Sep 2019 18:16:19 +0900 From: Sergey Senozhatsky To: Kees Cook Cc: Sergey Senozhatsky , Andrew Morton , Christophe Leroy , Peter Zijlstra , Drew Davenport , Arnd Bergmann , "Steven Rostedt (VMware)" , Feng Tang , Petr Mladek , Mauro Carvalho Chehab , Borislav Petkov , YueHaibing , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 7/7] bug: Move WARN_ON() "cut here" into exception handler Message-ID: <20190910091619.GA207290@jagdpanzerIV> References: <201908200943.601DD59DCE@keescook> <20190909160539.GA989@tigerII.localdomain> <201909100157.CEE99802C@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909100157.CEE99802C@keescook> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (09/10/19 01:59), Kees Cook wrote: > On Tue, Sep 10, 2019 at 01:05:39AM +0900, Sergey Senozhatsky wrote: > > On (08/20/19 09:47), Kees Cook wrote: > > [..] > > > + /* > > > + * 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_NO_CUT_HERE) == 0) > > > + printk(KERN_DEFAULT CUT_HERE); > > > > Shouldn't this be pr_warn() or pr_crit()? > > The pr_* helpers here would (potentially) add unwanted prefixes, so > those aren't used. KERN_DEFAULT is used here because that's how it's > always been printed. I didn't want to change that for this refactoring > work. I'm not opposed to it, generally speaking, though. :) I just glanced through CUT_HERE users warn_slowpath_fmt() pr_warn(CUT_HERE) __warn_printk() pr_warn(CUT_HERE) rdma_restrack_clean() pr_err("restrack: %s", CUT_HERE) rdma_restrack_clean() pr_err("restrack: %s", CUT_HERE) + oops/panic end markers are of pr_warn() or pr_crit() log levels. So I thought that maybe we can make it more or less similar. But if it has always been this way (KERN_DEFAULT) then OK. -ss