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=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 451E4C433DB for ; Tue, 23 Feb 2021 16:43:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CCFBC64E61 for ; Tue, 23 Feb 2021 16:43:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCFBC64E61 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 427F66B0006; Tue, 23 Feb 2021 11:43:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D8286B006E; Tue, 23 Feb 2021 11:43:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EEFC8D0001; Tue, 23 Feb 2021 11:43:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 1A80B6B0006 for ; Tue, 23 Feb 2021 11:43:10 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C8CC1180AD83A for ; Tue, 23 Feb 2021 16:43:09 +0000 (UTC) X-FDA: 77850102498.23.2328558 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf09.hostedemail.com (Postfix) with ESMTP id B1C3D6007BD6 for ; Tue, 23 Feb 2021 16:43:00 +0000 (UTC) IronPort-SDR: eUQzyq+Ytc+lRZufm/Em5sIfWOChXhiOugWsZ0pxT+ZxjWIPBYKU5nuITB8WvQxQi3tz0gHhY7 LLO7qVqx1aRw== X-IronPort-AV: E=McAfee;i="6000,8403,9904"; a="182386199" X-IronPort-AV: E=Sophos;i="5.81,200,1610438400"; d="scan'208";a="182386199" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2021 08:43:00 -0800 IronPort-SDR: LxxGQSXmOxBMVzabOGayCwNZzUooN3yUDHOZITiY+35PA9YN96upVylt9k/b/6RHe9ImCsDbjw pyIbzKxZHg6Q== X-IronPort-AV: E=Sophos;i="5.81,200,1610438400"; d="scan'208";a="364569260" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.146]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2021 08:43:00 -0800 Date: Tue, 23 Feb 2021 08:42:59 -0800 From: "Luck, Tony" To: Andy Lutomirski Cc: Aili Yao , HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+j44CA55u05LmfKQ==?= , dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, yangfeng1@kingsoft.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] x86/fault: Send a SIGBUS to user process always for hwpoison page access. Message-ID: <20210223164259.GA166727@agluck-desk2.amr.corp.intel.com> References: <20210223204436.1df73153@alex-virtual-machine> <788DFBA0-903F-4548-9C2F-B1A1543EE770@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <788DFBA0-903F-4548-9C2F-B1A1543EE770@amacapital.net> X-Stat-Signature: qg6wjeb8nn6et48mhh86omn686iciueo X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: B1C3D6007BD6 Received-SPF: none (intel.com>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=mga04.intel.com; client-ip=192.55.52.120 X-HE-DKIM-Result: none/none X-HE-Tag: 1614098580-521578 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 Tue, Feb 23, 2021 at 07:33:46AM -0800, Andy Lutomirski wrote: >=20 > > On Feb 23, 2021, at 4:44 AM, Aili Yao wrote: > >=20 > > =EF=BB=BFOn Fri, 5 Feb 2021 17:01:35 +0800 > > Aili Yao wrote: > >=20 > >> When one page is already hwpoisoned by MCE AO action, processes may = not > >> be killed, processes mapping this page may make a syscall include th= is > >> page and result to trigger a VM_FAULT_HWPOISON fault, as it's in ker= nel > >> mode it may be fixed by fixup_exception, current code will just retu= rn > >> error code to user code. > >>=20 > >> This is not sufficient, we should send a SIGBUS to the process and l= og > >> the info to console, as we can't trust the process will handle the e= rror > >> correctly. > >>=20 > >> Suggested-by: Feng Yang > >> Signed-off-by: Aili Yao > >> --- > >> arch/x86/mm/fault.c | 62 +++++++++++++++++++++++++++++--------------= -- > >> 1 file changed, 40 insertions(+), 22 deletions(-) > >>=20 > > Hi luto; > > Is there any feedback? >=20 > At the very least, this needs a clear explanation of why your proposed = behavior is better than the existing behavior. The explanation is buried in that "can't trust the process" line. E.g. user space isn't good about checking for failed write(2) syscalls. So if the poison was in a user buffer passed to write(fd, buffer, count) sending a SIGBUS would be the action if they read the poison directly, so it seems reasonable to send the same signal if the kernel read their poison for them. It would avoid users that didn't check the return value merrily proceedin= g as if everything was ok. -Tony