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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64, SPF_HELO_NONE,SPF_PASS 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 0DC89C433B4 for ; Thu, 8 Apr 2021 14:39:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 912EF610D0 for ; Thu, 8 Apr 2021 14:39:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 912EF610D0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 104DB8D0005; Thu, 8 Apr 2021 10:39:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DD6F8D0002; Thu, 8 Apr 2021 10:39:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE60A8D0005; Thu, 8 Apr 2021 10:39:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id D2B1D8D0002 for ; Thu, 8 Apr 2021 10:39:13 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 922F29426 for ; Thu, 8 Apr 2021 14:39:13 +0000 (UTC) X-FDA: 78009457386.35.9FB8D9C Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf29.hostedemail.com (Postfix) with ESMTP id DE024DE for ; Thu, 8 Apr 2021 14:39:10 +0000 (UTC) IronPort-SDR: qnK7PCvpcLyVaKmCBXzeP7ycNK8DIVv+Bfc7i+4s78Yq1igkUsCCmvrItm2ShShAAptIwNGzf1 fk3TFl9Tdw4A== X-IronPort-AV: E=McAfee;i="6000,8403,9948"; a="213962809" X-IronPort-AV: E=Sophos;i="5.82,206,1613462400"; d="scan'208";a="213962809" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2021 07:39:10 -0700 IronPort-SDR: X/kVjaTo9Okcc1DAfz/wFhJ8An0Rv4xFM/Puw+ACxQ4c7BCphuDDsJZtyZ4gUzu0UlRuHiSw1c i5JL2hJOS22g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,206,1613462400"; d="scan'208";a="380276511" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga003.jf.intel.com with ESMTP; 08 Apr 2021 07:39:10 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 8 Apr 2021 07:39:09 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 8 Apr 2021 07:39:09 -0700 Received: from fmsmsx610.amr.corp.intel.com ([10.18.126.90]) by fmsmsx610.amr.corp.intel.com ([10.18.126.90]) with mapi id 15.01.2106.013; Thu, 8 Apr 2021 07:39:09 -0700 From: "Luck, Tony" To: Aili Yao , Borislav Petkov CC: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Andy Lutomirski , =?iso-2022-jp?B?SE9SSUdVQ0hJIE5BT1lBKCAbJEJLWTh9ISFEPkxpGyhCKQ==?= Subject: RE: [RFC 0/4] Fix machine check recovery for copy_from_user Thread-Topic: [RFC 0/4] Fix machine check recovery for copy_from_user Thread-Index: AQHXIdNYiHm6dP/RhkeqE8lsAeByWKqqa0GAgABaGyA= Date: Thu, 8 Apr 2021 14:39:09 +0000 Message-ID: <595ed0ac4fbb470ca9cfd256aaf1810e@intel.com> References: <20210326000235.370514-1-tony.luck@intel.com> <20210408101335.28fd3692@alex-virtual-machine> In-Reply-To: <20210408101335.28fd3692@alex-virtual-machine> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.1.200.100] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: DE024DE X-Stat-Signature: re53z1ua1aryxejb7wpzbg5pjw6phis9 Received-SPF: none (intel.com>: No applicable sender policy available) receiver=imf29; identity=mailfrom; envelope-from=""; helo=mga01.intel.com; client-ip=192.55.52.88 X-HE-DKIM-Result: none/none X-HE-Tag: 1617892750-499397 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000009, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > I have one scenario, may you take into account: > > If one copyin case occurs, write() returned by your patch, the user proce= ss may > check the return values, for errors, it may exit the process, then the er= ror page > will be freed, and then the page maybe alloced to other process or to ker= nel itself, > then code will initialize it and this will trigger one SRAO, if it's used= by kernel, > we may do nothing for this, and kernel may still touch it, and lead to on= e panic. In this case kill_me_never() calls memory_failure() with flags =3D=3D 0. I = think (hope!) that means that it will unmap the page from the task, but will not send a s= ignal. When the task exits the PTE for this page has the swap/poison signature, so= the page is not freed for re-use. -Tony