Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp680547pxb; Thu, 30 Sep 2021 14:54:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxupPhjdDtCYKoe8SIMwhtBMK5Ss0khjx4J5vqsAWQhf5D7MlZImnXtxi3tNLtoT6VC8VWB X-Received: by 2002:a17:902:b70d:b0:13d:f6c9:2066 with SMTP id d13-20020a170902b70d00b0013df6c92066mr6263478pls.2.1633038887665; Thu, 30 Sep 2021 14:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633038887; cv=none; d=google.com; s=arc-20160816; b=PkMmjH3RblpcPwYktc0XJuLonZ0ygwUHNd44N0aY27FmuuQLs+Ywj5Aue4GHhhKGgw QISw2VuHihDR43lacxwFbKTqn32rn0H2HBqQP1dlV+DFfvZFPYNxwvLIMDOcwe4kW0z4 2e5nupoTaFKgtIAAjasndCL6rbfTZVfmaxMg7ffK/B1i9x6C7b5dtD+cn6imrYRhLvxa 4Cj4QH+D9u7oNDsD0Yjxur80/9aDE8PzrdvkA3BvPfXIkl38l2ulMsJnj6cnuhO9lRKM 4v7r2NRKzHV4m/BA5/4E17eCD4CqHcAXYKgCN4NcBP4CR0figHwD+9VF9XYzetBJZ16M zEwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rRzmSQnYKN75Gg93YuIv+rBGX5i47OpZAXZvIJOPAT0=; b=Ahr2qyWc9Bn+bLSYh9zyWfy43zCJCu3LhjlX9cZC9x1OvRcb6ULzGkKKkaM8h6jRxu l7opfWoVYNf6gk2K8H7mWRRhcRj4sIHwBlx6dhx6QpW5OABUkLDJxSLnR5ZX19GzCS4w M+vxlmtbuKh/EzhXXSlzhd5CYfsXqfFamoTfLwAFmH1G5ssKTKoIgYUzXge1lkiDnKHs A4CPXJUGSG6a/sqk8iAsdS9WUN7nYCROHUz3zKugfZotjZt0XB3Xu4P/pFPpDuQpUbgB 3cNlCryUZg5ru6B8FqSNeZtG8XejkLg3SRNeyNqYx/d3kaWNvH8HlW0Uf8lkTVs/T/95 K65A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lEQ8DLBf; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a72si5463562pge.363.2021.09.30.14.54.34; Thu, 30 Sep 2021 14:54:47 -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=@chromium.org header.s=google header.b=lEQ8DLBf; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351118AbhI3SWV (ORCPT + 99 others); Thu, 30 Sep 2021 14:22:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350998AbhI3SWT (ORCPT ); Thu, 30 Sep 2021 14:22:19 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE0FFC06176A for ; Thu, 30 Sep 2021 11:20:36 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id oa12-20020a17090b1bcc00b0019f715462a8so128737pjb.3 for ; Thu, 30 Sep 2021 11:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rRzmSQnYKN75Gg93YuIv+rBGX5i47OpZAXZvIJOPAT0=; b=lEQ8DLBf3vFDxlv1guB97pybHM/E5OgqqY7s5GW48JHxOcQmMFcVANRfaTHTtWIF9Y 9kRwW6x+vjlSmmTqC0Stb7CrJ/tg3DjlMrf5MAtA7cjscqC+AIUITJ17K3S1fLhd9/Xb H6Q003Tl/g15SHWxlAxw0KfC0GrYBfK6GsZ94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rRzmSQnYKN75Gg93YuIv+rBGX5i47OpZAXZvIJOPAT0=; b=SeyNojFWkiz+9wj4H4Oa3ZiIcQTmoq0BJMN51LxOwe8zriMoywDJkFf/V58SIabZ4X MSZtmfd8lQt9HuI9BPGiWyu8DNF5EU8nhxv9KqBjtWfuM2zB0f1k0LTveVaWLCeG7iME 6r6aKv6XQ4OWLqSXCrCLFmNO1v3eMHZgsJJWnylcD/Ek0n3uyXi1O7BbDgV0xyUkR3Qn mP3IlrgLUauFu0RaLdkr5pcdz4G3RxQtOXF2d/jaPXn5pTWvUEP0XpRZvY+soa4aEOfa uz+mQlfewOx1xC6NymRPTSDPCV7AASp9sDJsFUFQHjM41vRPjJGLbyzeAri04/r21Z/+ EXOQ== X-Gm-Message-State: AOAM532mYgcifjzwtzkd5ALB2wOn1ysD634aHwPbMCncucqcCdDQ6UJG AsRZdoXGLG9HDMWkBQPNe48YoA== X-Received: by 2002:a17:903:2c2:b029:101:9c88:d928 with SMTP id s2-20020a17090302c2b02901019c88d928mr5409323plk.62.1633026036390; Thu, 30 Sep 2021 11:20:36 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l10sm3720957pff.119.2021.09.30.11.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 11:20:35 -0700 (PDT) Date: Thu, 30 Sep 2021 11:20:34 -0700 From: Kees Cook To: Alexander Popov Cc: Dave Hansen , Peter Zijlstra , Jonathan Corbet , Paul McKenney , Andrew Morton , Thomas Gleixner , Joerg Roedel , Maciej Rozycki , Muchun Song , Viresh Kumar , Robin Murphy , Randy Dunlap , Lu Baolu , Petr Mladek , Luis Chamberlain , Wei Liu , John Ogness , Andy Shevchenko , Alexey Kardashevskiy , Christophe Leroy , Jann Horn , Greg Kroah-Hartman , Mark Rutland , Andy Lutomirski , Dave Hansen , Steven Rostedt , Will Deacon , David S Miller , Borislav Petkov , kernel-hardening@lists.openwall.com, linux-hardening@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, notify@kernel.org Subject: Re: [PATCH] Introduce the pkill_on_warn boot parameter Message-ID: <202109301120.B7B8F3F8A@keescook> References: <20210929185823.499268-1-alex.popov@linux.com> <323d0784-249d-7fef-6c60-e8426d35b083@intel.com> <202109291229.C64A1D9D@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 04:55:37PM +0300, Alexander Popov wrote: > The kernel can hit warning and omit calling __warn() that prints the message. > But pkill_on_warn action should be taken each time. > > As I can understand now, include/asm-generic/bug.h defines three warning > implementations: > 1. CONFIG_BUG=y and the arch provides __WARN_FLAGS. In that case pkill_on_warn > should be checked in report_bug() that you mention. > 2. CONFIG_BUG=y and the arch doesn't have __WARN_FLAGS. In that case > pkill_on_warn should be checked in warn_slowpath_fmt(). > 3. CONFIG_BUG is not set. In that case pkill_on_warn should not be considered. > > Please, correct me if needed. That looks correct to me, yes. -- Kees Cook