Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp959893ybj; Thu, 7 May 2020 11:26:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLCU4e9dA+Cn7dljVhMsRgyq+r2gDcwjSkkUncfwuKaSydh8/5+SAe6+wn/v4UUlykZNGl/ X-Received: by 2002:a05:6402:88b:: with SMTP id e11mr12851890edy.176.1588875960870; Thu, 07 May 2020 11:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588875960; cv=none; d=google.com; s=arc-20160816; b=R431xn7Yal0EVO8uyO5A62NExZk4t94oqikqb/69Af+UdDeHkhMxeIVZexR1r593w2 2ip/8hcOzJRKpt7TgQs8XtsBtj+mMJ0FbT8IGyxFZQN4wbRRxUaAC+xINs/Jy7/MX/P6 wqzrUDpiNeHHx93BUvSQsOQ+FpFxf8dho2RkkJP259gSRLUeJ41UlK/qIQ793p1vt4DF 0C/D3b3NJtBZJJ5WouxyXTyNQ4Gq08NmRuC5JPU7fqnXE9kCHKhpC3X1Gbm3v4337vAr 906VykQrpUatujmq7vZ99qh/okik44u4KQzplf+ewcOhjZrNZ6nlx8cqxSdCIY2mf2p0 IIQQ== 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; bh=crOGNM1IiUdeKZ/Udc473eZwbzdnFX83mUx0lAy7H7w=; b=d8C4uXaT8oOyl3dRN+kVOC4i9xh8f6fIKFClxTeIcb69L9EtrorwnBf+WDnfORgROD YV9mms6+UYgAXiSJkw1WAFZR/L/tvjWNEMWPGbOUg3qeyozN5BVd4OQLzoigT62S3bsT z3HgYINQptak4j2kkv8+oaAyoBryoNHm3FgECI7ap6EqoynP7UOojkrNQBFsH7J0fRfC wZo0vzOXadfCh2uplcvGGw/p4eq6MZQYTnHmnkzcIv7eySy+MURbuH5xjiWmMjW+xfO+ KzgbiJCmHMzua82gdZIYfpKtGWOtaZMhwGElAWPjC+A0O1Aqojk/E+YZ/dNtmO06QkoE VgCQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h20si3701826eds.141.2020.05.07.11.25.36; Thu, 07 May 2020 11:26:00 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728326AbgEGSXB (ORCPT + 99 others); Thu, 7 May 2020 14:23:01 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:35144 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726863AbgEGSXA (ORCPT ); Thu, 7 May 2020 14:23:00 -0400 Received: by mail-pj1-f68.google.com with SMTP id ms17so2997470pjb.0; Thu, 07 May 2020 11:22:59 -0700 (PDT) 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=crOGNM1IiUdeKZ/Udc473eZwbzdnFX83mUx0lAy7H7w=; b=WbuHqxk+AdWTuV7r8z7510wccudAPgeCTPKpyIomIGpEaCBfAQKYf4fbWkRv+h2pD3 k7oV2HsHzcYijcjFfND0uVUDrI3c++5YdPyqtTYiF7yfL5wtvtcIOsVPN7KEaOgM0oed dWYmcVuhqfTbU85qds9qo+iRr0SyNyabIrIxzGb5RV1s6O7E2YNst7llAX4KWKMCqusS 6xwnfIro1x679JKck+qUnjCIPwr0LRpCPUY+RDAfwuFy8AmCsBjkcqcl8J3p5qBiLPJC wyvVdozulcXLNxZoTR322JwkTkuLmXLL/a218yG3lmhQFj+axxI66fSjVFna2JospJLt Mu3g== X-Gm-Message-State: AGi0PuZ3NkBv112mEcylHZG7YEAQ4wC6NGWnIgvZHR8zniH+d9mwa5A1 xCryH86gj4V19eiUfMIsKrs= X-Received: by 2002:a17:902:b206:: with SMTP id t6mr14698777plr.270.1588875779441; Thu, 07 May 2020 11:22:59 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id 192sm5459770pfu.182.2020.05.07.11.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 11:22:58 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id CF043403EA; Thu, 7 May 2020 18:22:57 +0000 (UTC) Date: Thu, 7 May 2020 18:22:57 +0000 From: Luis Chamberlain To: Rafael Aquini Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, dyoung@redhat.com, bhe@redhat.com, corbet@lwn.net, keescook@chromium.org, akpm@linux-foundation.org, cai@lca.pw, rdunlap@infradead.org Subject: Re: [PATCH v2] kernel: add panic_on_taint Message-ID: <20200507182257.GX11244@42.do-not-panic.com> References: <20200507180631.308441-1-aquini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200507180631.308441-1-aquini@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 07, 2020 at 02:06:31PM -0400, Rafael Aquini wrote: > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 8a176d8727a3..b80ab660d727 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -1217,6 +1217,13 @@ static struct ctl_table kern_table[] = { > .extra1 = SYSCTL_ZERO, > .extra2 = SYSCTL_ONE, > }, > + { > + .procname = "panic_on_taint", > + .data = &panic_on_taint, > + .maxlen = sizeof(unsigned long), > + .mode = 0644, > + .proc_handler = proc_doulongvec_minmax, > + }, You sent this out before I could reply to the other thread on v1. My thoughts on the min / max values, or lack here: Valid range doesn't mean "currently allowed defined" masks. For example, if you expect to panic due to a taint, but a new taint type you want was not added on an older kernel you would be under a very *false* sense of security that your kernel may not have hit such a taint, but the reality of the situation was that the kernel didn't support that taint flag only added in future kernels. You may need to define a new flag (MAX_TAINT) which should be the last value + 1, the allowed max values would be (2^MAX_TAINT)-1 or (1<