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=-14.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 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 9207CC433E0 for ; Thu, 25 Feb 2021 05:02:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C92BC64ED9 for ; Thu, 25 Feb 2021 05:02:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C92BC64ED9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kingsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 441296B006E; Thu, 25 Feb 2021 00:02:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CA316B0070; Thu, 25 Feb 2021 00:02:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 243A26B0071; Thu, 25 Feb 2021 00:02:37 -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 089066B006E for ; Thu, 25 Feb 2021 00:02:37 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AF2A0184FE9C5 for ; Thu, 25 Feb 2021 05:02:36 +0000 (UTC) X-FDA: 77855594712.14.646F929 Received: from mail.kingsoft.com (mail.kingsoft.com [114.255.44.145]) by imf18.hostedemail.com (Postfix) with ESMTP id A9E7A200038C for ; Thu, 25 Feb 2021 05:02:33 +0000 (UTC) X-AuditID: 0a580157-f39ff7000005df43-90-603725882e1d Received: from mail.kingsoft.com (localhost [10.88.1.32]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.kingsoft.com (SMG-1-NODE-87) with SMTP id 5F.A1.57155.88527306; Thu, 25 Feb 2021 12:20:24 +0800 (HKT) Received: from alex-virtual-machine (172.16.253.254) by KSBJMAIL2.kingsoft.cn (10.88.1.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 25 Feb 2021 12:47:12 +0800 Date: Thu, 25 Feb 2021 12:47:11 +0800 From: Aili Yao To: "Luck, Tony" CC: Andy Lutomirski , "HORIGUCHI =?UTF-8?B?TkFPWUE=?=( =?UTF-8?B?5aCA5Y+j44CA55u05Lmf?=)" , , , , , , , , , , , , Subject: Re: [PATCH v3] x86/fault: Send a SIGBUS to user process always for hwpoison page access. Message-ID: <20210225124711.35b31965@alex-virtual-machine> In-Reply-To: <20210223164259.GA166727@agluck-desk2.amr.corp.intel.com> References: <20210223204436.1df73153@alex-virtual-machine> <788DFBA0-903F-4548-9C2F-B1A1543EE770@amacapital.net> <20210223164259.GA166727@agluck-desk2.amr.corp.intel.com> Organization: kingsoft X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [172.16.253.254] X-ClientProxiedBy: KSBJMAIL1.kingsoft.cn (10.88.1.31) To KSBJMAIL2.kingsoft.cn (10.88.1.32) X-Brightmail-Tracker: H4sIAAAAAAAA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Signature: yxmibudqskww5ym4adyco5aqruatxm5f Received-SPF: none (kingsoft.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=mail.kingsoft.com; client-ip=114.255.44.145 X-HE-DKIM-Result: none/none X-HE-Tag: 1614229353-616033 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, 23 Feb 2021 08:42:59 -0800 "Luck, Tony" wrote: > 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 > >=20 > > At the very least, this needs a clear explanation of why your proposed = behavior is better than the existing behavior. =20 >=20 > The explanation is buried in that "can't trust the process" line. >=20 > 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. >=20 > It would avoid users that didn't check the return value merrily proceeding > as if everything was ok. Hi luto: I will add more infomation: Even if the process will check return value of syscall like write, I don= 't think process will take proper action for this. In test example, the return value will be errno is 14 (Bad Address), the= process may not realize this is a hw issue, and may take wrong action not as expected. And totally, A hw error will rarely happen, and the hw error hitting thi= s branch will be more unlikely, the impaction without this patch is quite minor, but this is= still not good enough, we should make it better, right? Thanks Aili Yao =20