Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3934633ybl; Mon, 3 Feb 2020 09:17:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwswJaFku9f4f1r/Zv3A6BWR3NCdZrHO7tViCNttrY0VLqePgj//nqW+ynoO6PcV+4EJbWN X-Received: by 2002:a9d:6290:: with SMTP id x16mr17989011otk.343.1580750227230; Mon, 03 Feb 2020 09:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580750227; cv=none; d=google.com; s=arc-20160816; b=ATqx6SKsv7DV3egYJJgn8+qOJWWCbFTvzC4+SfRR9bQbmEpkd5+vKFGiLIF8Un3r/4 C0fND3TY6jTmSFocXkbEJCZhfvdfw7c23kLlDysS8IjxsAG7K1OTLpukD//GUpLcMH4z sF74iqt7bn+OHyyHKoBXQVFZFkCYV9VHgIH82rzrePXgyUwlv095G9ucnCy01XJjxra9 8Sxx2OWKqoImBVSTk8t9z1HkvyH/ZUPxkNm8WBigDCpbgHScnzX3p0zIbDfKvPgm6tHm UVOGwlvf4bxAUAYTZononPWrWfyurMtZfALwp9qyy5voiR2ZTesqu1GSGiQuTB8z8VG7 udAw== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=2Pqrua2aNFk7E/aM7DpxoCGO3yfSkT75o/9HVLjio40=; b=cKhgX+CRaS/DJ//mBP6l/67zoQL+1rN6vPzXh2cMGihyDEbVvNfbSs1rpeExWfT1oS 7kkp2AXPrCWSMvQ6HdojEK1U0cZgnVfcg+dE6MZ0aYMdyec306Na8MxXmBT7a0psMKBT 1hDWV0+L7OlylnXB8QGb/Zs5BP93uTT4n/YVwuECmJ7Fr2LSRiNAYtBlUIi5OusrVIhz X3fQY17rh8XfKVgiPT5Zobds/GSJpXIT1ZWpCcucN7VJdBMS3LOeN1AbCgp6nFDFI9iJ K1P1h+gHpxlkqtHkDoR15w7BEdWiwRoLeh6vhXdEMBX2pI63Fmo9S5CBDuqiHGyWKXbz 6gFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=LcxRinM2; 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 a28si11628649otd.257.2020.02.03.09.16.54; Mon, 03 Feb 2020 09:17:07 -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; dkim=pass header.i=@lca.pw header.s=google header.b=LcxRinM2; 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 S1727674AbgBCPGP (ORCPT + 99 others); Mon, 3 Feb 2020 10:06:15 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41109 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbgBCPGP (ORCPT ); Mon, 3 Feb 2020 10:06:15 -0500 Received: by mail-qk1-f196.google.com with SMTP id u19so6816532qku.8 for ; Mon, 03 Feb 2020 07:06:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=2Pqrua2aNFk7E/aM7DpxoCGO3yfSkT75o/9HVLjio40=; b=LcxRinM2Jd9ZtyI8A7OgwoRNBBwgVfxoTw6F2jIR/AQl8pk64TjhQ83Cgt88DEcwu8 qF1fGj5ySzOctBIB6rYgyb4l17jteIrYZ7n09VpQXMmBaTX69+0hqWVfg2QbGGU4xiwZ 4aUlfX7a+tZjA30Sgq7VZkPf/GVQGErTBzplWBIpRMuBw5btDuVxZ7asEfhy3WOBix8b veiN8k/FQZoqk5SPTvC86FgDgOaK0993N/Y3UZgGiao9dE6ck8n1p/KNvMqQo3fX/ZFi LOjzPOdSO3KUBdeFPvDLHMg3HQJHv7JIuUFL1vFRwzkoFo6yyNLCRVOXUo7HrKlcnDl4 zRLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=2Pqrua2aNFk7E/aM7DpxoCGO3yfSkT75o/9HVLjio40=; b=qLS+aV/1xsdKXaXe5ixuEoK9t7uGbrNQHFrS7ejPSHYzWEVZnoEauT6b/dJ0IRPrXY 7dgM/ZuyDrIqe1OqomO6AxdX+pEchgSGdrR+LqM6qdobkGUNW8FwrbfQl2grTeO57mrc lAA28gm5uGo4622kvh0vyXOCUMmcE96F2aHaDFQdelIWxa9ObLTISxzxJOmjrsS/bZBe swJSg+oXmnh+ywCqa6kAH9kf13ShWfp1qJIwkAOgFDXETJXFBE+eQ47zR2NKBNg3i40C NKiaPLR2qJKzE9zlQHDemSCLgAiDlsxbS89P/EC/56kFBCju9BLUzfAYB99KnAxcGtvJ 8bIQ== X-Gm-Message-State: APjAAAX/NhOWjE13rjgd4FyDxAsDTQZ8AsZStPzt7Kq/56gH4RYlQ8dF 4d/t5/z8xo1ElSEbIwD2SAvXYg== X-Received: by 2002:a37:9d44:: with SMTP id g65mr10795127qke.15.1580742374374; Mon, 03 Feb 2020 07:06:14 -0800 (PST) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id i28sm10543162qtc.57.2020.02.03.07.06.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Feb 2020 07:06:13 -0800 (PST) Message-ID: <1580742371.7365.1.camel@lca.pw> Subject: Re: [PATCH 1/1] mm: sysctl: add panic_on_inconsistent_mm sysctl From: Qian Cai To: Christian Borntraeger , Grzegorz Halat Cc: Linux Kernel Mailing List , Linux-MM , linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, ssaner@redhat.com, atomlin@redhat.com, oleksandr@redhat.com, vbendel@redhat.com, kirill@shutemov.name, khlebnikov@yandex-team.ru, Andrew Morton , Iurii Zaikin , Kees Cook , Luis Chamberlain , Jonathan Corbet , Tetsuo Handa Date: Mon, 03 Feb 2020 10:06:11 -0500 In-Reply-To: <34467005-1742-47a0-cd2b-05567584b91e@de.ibm.com> References: <20200129180851.551109-1-ghalat@redhat.com> <84C253EB-B348-4B62-B863-F192FBA8C202@lca.pw> <34467005-1742-47a0-cd2b-05567584b91e@de.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-02-03 at 15:08 +0100, Christian Borntraeger wrote: > > On 29.01.20 19:39, Qian Cai wrote: > > > > > > > On Jan 29, 2020, at 1:08 PM, Grzegorz Halat wrote: > > > > > > Memory management subsystem performs various checks at runtime, > > > if an inconsistency is detected then such event is being logged and kernel > > > continues to run. While debugging such problems it is helpful to collect > > > memory dump as early as possible. Currently, there is no easy way to panic > > > kernel when such error is detected. > > > > > > It was proposed[1] to panic the kernel if panic_on_oops is set but this > > > approach was not accepted. One of alternative proposals was introduction of > > > a new sysctl. > > > > > > Add a new sysctl - panic_on_inconsistent_mm. If the sysctl is set then the > > > kernel will be crashed when an inconsistency is detected by memory > > > management. This currently means panic when bad page or bad PTE > > > is detected(this may be extended to other places in MM). > > > > > > Another use case of this sysctl may be in security-wise environments, > > > it may be more desired to crash machine than continue to run with > > > potentially damaged data structures. > > > > It is annoying that I have to repeat my feedback, but I don’t know why > > admins want to enable this by allowing normal users to crash the systems > > more easily through recoverable MM bugs where I am sure we have plenty. > > How does that improve the security? > > There are cases where data corruption is a no-go, while "one node going down" > is acceptable. > And then there is also the case for payed service providers that often need > a dump at the time of the problem to understand rare issues. > > So I DO see value in such a thing. We should just piggy-back on panic_on_warn > I guess. > Indeed, so change pr_alert() to pr_warn() there then?