From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16A2DC35249 for ; Mon, 3 Feb 2020 15:06:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CE8F82080C for ; Mon, 3 Feb 2020 15:06:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="LcxRinM2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE8F82080C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 601746B0676; Mon, 3 Feb 2020 10:06:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 58AFC6B0677; Mon, 3 Feb 2020 10:06:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 453266B0678; Mon, 3 Feb 2020 10:06:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 285D56B0676 for ; Mon, 3 Feb 2020 10:06:16 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CDCC58248047 for ; Mon, 3 Feb 2020 15:06:15 +0000 (UTC) X-FDA: 76449141510.08.spade33_369a8b565ca5b X-HE-Tag: spade33_369a8b565ca5b X-Filterd-Recvd-Size: 5499 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Mon, 3 Feb 2020 15:06:15 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id w25so14508141qki.3 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=dbR64KoFVaza1lo1nyefgCAhFL1iVgYhK8xic+pjp4hL9lvz6LXpBYR9ISxC+nyAY9 q4rNpkQ4RXn0hF1JI7RwIEt2cNVVZzMBn3BTfTTMkr+a6KdmzcCpp2gf3p76OJJ9wYKq mzSC/Jce2aIBTTXysrn+Yf0SVP6wBK3663O+FRTeIlTMnoO3u0a4P7LteuNoOVu0r/Ly 3CqLMAABz/At/hxgB3jbLE0f6CUft1Gfk38No6fCAJffaHE6DcbHI6Fi+VF0s8oFApHW S1wQCxhpee4SvYjdAgnaPHm+U2iI5SmC77v67DUwo2MxMQ4H/q+/4yajZGOR0X1klbBD 5qQA== X-Gm-Message-State: APjAAAVWD62I+JubxMl1ioapCOxBjUORtybROb14JKgWBw4YG1H0P35I 5Mri2G+G6Lgl+A2PdRCfk/zVXg== X-Google-Smtp-Source: APXvYqyqItfjETcCSYHpKDhogrMUuY03DaFYMc/nGKpzOi93kS/qtSJ47mCv2S/o6vqvOPD4MEyUbw== 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: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 2020-02-03 at 15:08 +0100, Christian Borntraeger wrote: >=20 > On 29.01.20 19:39, Qian Cai wrote: > >=20 > >=20 > > > On Jan 29, 2020, at 1:08 PM, Grzegorz Halat wro= te: > > >=20 > > > 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 co= llect > > > memory dump as early as possible. Currently, there is no easy way t= o panic > > > kernel when such error is detected. > > >=20 > > > 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 introdu= ction of > > > a new sysctl. > > >=20 > > > Add a new sysctl - panic_on_inconsistent_mm. If the sysctl is set t= hen 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). > > >=20 > > > Another use case of this sysctl may be in security-wise environment= s, > > > it may be more desired to crash machine than continue to run with > > > potentially damaged data structures. > >=20 > > It is annoying that I have to repeat my feedback, but I don=E2=80=99t= know why > > admins want to enable this by allowing normal users to crash the syst= ems > > more easily through recoverable MM bugs where I am sure we have plent= y. > > How does that improve the security? >=20 > There are cases where data corruption is a no-go, while "one node going= down"=20 > 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. >=20 > So I DO see value in such a thing. We should just piggy-back on panic_o= n_warn > I guess. >=20 Indeed, so change pr_alert() to pr_warn() there then?