Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3750730imu; Mon, 28 Jan 2019 10:08:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN65Zr+Ad9c1viyLL3TeQM+D7zvQ5O3+GeBE2niqgZf8HwSTpZzDm0aeJHYl0/y4jQSiHwyc X-Received: by 2002:a17:902:74cc:: with SMTP id f12mr22908792plt.134.1548698886551; Mon, 28 Jan 2019 10:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548698886; cv=none; d=google.com; s=arc-20160816; b=RQs9ZCG1MA+gk8w+2fMNGcRAJK08uG4G53aXkh/9iCVBZdlJw1CaRf+mCwGQkNtWnU RJvXY//qEjcptRUMQrvxaLdVUeyl9zBqXrV2cl1BOvdxOVkjdXeniGwqCy6/IEMSlZTZ N2KdyiA9obPcnmT2xk6d1gBKsb76JLFTcH/KDqSj0M+SslP7Opu05K/5UMEhyBLALbcD 2HZd36f2gfllvVSgG65VqmdpH0mlqms3w3FetJRcaHihQnzsmsY1Rb0c5c2gCKDTIzXb Bkh4d+ChpgLunhKSzZnTLPgsP9fPYeCsMzbgLFSAqS4ceuY+Rp7SPAXjuiTMw9VnlU6y ub6Q== 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=EUB5ZAt0jZv9mnWUT7LeIsgP6arbQ2BTQGY6a7GD+0s=; b=ooZ12o2YXu/rGbxfLGkWCvtLu+VAH8BUEMSre9sCnHAmwGKgNLKJh92BCZ02QD+WVe nrCg5sS3yl3DRXH2z2mjjwH5gJazBr9Z6HUwfC6Bw/du8yBmtNOSceyLJ2XXVpZp3sXc ofoQnfj7QQfT75SRhZriEHZXSDLVjVS0VP59nonKx/ki1eJxcgOvwFN7akEF+5BXpLcK wizFK0uOCoXq6qlPV1jTDSr1qACuUR3MnLj9PkL8+d19HFcnuW7Lyu/JjdvUWJBMxHQG jm+QCTL2dM3JAqsMZe3Hr1gyZ58tfQxqB1JJ7OwvX4aa8tNCsbmhIMcKxboWcpqAOcWQ Yg9Q== 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 w12si5729553pfn.212.2019.01.28.10.07.51; Mon, 28 Jan 2019 10:08:06 -0800 (PST) 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 S1727558AbfA1SFu (ORCPT + 99 others); Mon, 28 Jan 2019 13:05:50 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54364 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727192AbfA1SFs (ORCPT ); Mon, 28 Jan 2019 13:05:48 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F24D62548; Mon, 28 Jan 2019 18:05:46 +0000 (UTC) Date: Mon, 28 Jan 2019 10:05:45 -0800 From: Andrew Morton To: Vincent Whitchurch Cc: mcgrof@kernel.org, keescook@chromium.org, linux-kernel@vger.kernel.org, Vincent Whitchurch Subject: Re: [PATCH v2] sysctl: Add panic-fatal-signals Message-Id: <20190128100545.b62193aa8f49e1de8d6ea8b7@linux-foundation.org> In-Reply-To: <20190128084959.13060-1-vincent.whitchurch@axis.com> References: <20190128084959.13060-1-vincent.whitchurch@axis.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; 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 Mon, 28 Jan 2019 09:49:59 +0100 Vincent Whitchurch wrote: > Add a sysctl which asks the kernel to panic when any userspace process > receives a fatal signal which would trigger a core dump. This has > proven to be quite useful when debugging problems seen during testing of > embedded systems: When combined with kernel core dumps (saved due to > the panic), it allows easier debugging of crashes which have their > origin in system-wide problems such as buggy drivers or other kernel or > hardware-related issues. > > The crashing process's core dump can be extracted from the kernel core > dump using tools such as the crash utility's gcore extension. > I can't speak to the usefulness of this, but the feature is small and simple. Some documentation would be appreciated. I assume in Documentation/sysctl/kernel.txt. Please also check that print-fatal-signals is appropriately documented while we're in there - it's documented in Documentation/admin-guide/kernel-parameters.rst but not Documentation/sysctl/kernel.txt. > v2: Put the sysctl behind a config option I suppose so... The option is root-only (surely?) so I'm not sure this is really needed. > ... > > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -1242,6 +1242,20 @@ config SYSCTL_SYSCALL > > If unsure say N here. > > +config SYSCTL_PANIC_FATAL_SIGNALS > + bool "panic-fatal-signals sysctl" if EXPERT > + depends on PROC_SYSCTL > + help > + If you say Y here, a kernel.panic-fatal-signals sysctl will be > + offered. If this sysctl is turned on, the kernel will panic if any > + userspace process receives a fatal signal which would trigger a core > + dump. > + > + When used together with kernel core dumps, this can be useful for > + debugging some system-wide problems, primarily on embedded systems. > + > + If unsure, say N. I suggest that the Kconfig help and the forthcoming documentation should clearly explain the dangers of enabling this!