Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp754357pxf; Wed, 10 Mar 2021 17:21:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJznTutEMUYmiPTQrfQoAahsc1Pl+ZLVp32iuq+LNhTl2kLWl4434DmHYEdhazpRd1yBpVDI X-Received: by 2002:a05:6402:646:: with SMTP id u6mr6242648edx.250.1615425689844; Wed, 10 Mar 2021 17:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615425689; cv=none; d=google.com; s=arc-20160816; b=Mdb+1t6SO5EeYJGCaIWOdSU028tExQQFfdJV1eudc3PTsLZPyMkaf0qJB+7Y4e75la +8YASXE+nlc2m6TgQ0+zbq7TRkytCbIoWXC5kMwp/3Bj7t114XQSHCn/FaoVojyJMajc 61GY2/YPjxLLA9/D48D3RGUz3UrwOnM5vbw27dkPW/SFAM1+3JuW1Jdhn8hDQPm+HcVB G8OpdbI/e2tGSJWMystJbsqoabu51n6E9ofJ502qpISSJQDU8mCng84q1oV4rGyT4C7S HDVNgT9KjU/W0F8hrwq0qHd4SM8cK4dOpvfgM7jl95cYtN6jaNFRCsaB8RBtHKtQXAxo hmGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=LOjz/mOKl1vvzrafG/87BTBmIVKTc3UwhCVG222q+ok=; b=D0uVpkVbAPUZOprS9SoxDg4S7BJeFKLK2W2dALD/2x0E9YOGKiZMkwBHKECaCQDuyL AHhyYxvvCrKLksnGgXzMwRDJtaLd9FBhdVLIdFVMBjNVhlM6tGgtbNrDG1vF2Q+PkJ0h WW356fnedIcBWaFPRvLfq2r4C+yGU/qCxkKbAYpwTlTSruc5zeINU0EyMpUcihkyFpPz gaDsytI6ETL3qUipk3UTEBNCJekmzV8KUSeawqO0yXo4KdYcak19f1ZE19JbaBMakkIK fqTF1QAJsMR6GYagaerWB+jLkX0QmWYd7eUyqHm0ZbPwxo/rH9BeyJ6o7bHw2G0I3r4F Tzzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si694472edp.540.2021.03.10.17.21.07; Wed, 10 Mar 2021 17:21:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbhCKBUL convert rfc822-to-8bit (ORCPT + 99 others); Wed, 10 Mar 2021 20:20:11 -0500 Received: from mail.kingsoft.com ([114.255.44.146]:47457 "EHLO mail.kingsoft.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229569AbhCKBTo (ORCPT ); Wed, 10 Mar 2021 20:19:44 -0500 X-AuditID: 0a580155-1f5ff7000005482e-6d-604968aae979 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-2-NODE-85) with SMTP id 4C.75.18478.AA869406; Thu, 11 Mar 2021 08:47:38 +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.2176.2; Thu, 11 Mar 2021 09:19:41 +0800 Date: Thu, 11 Mar 2021 09:19:41 +0800 From: Aili Yao To: Andy Lutomirski CC: "Luck, Tony" , Oleg Nesterov , Linux API , Andy Lutomirski , HORIGUCHI NAOYA , Dave Hansen , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , , Linux-MM , LKML , , Subject: Re: [PATCH v3] x86/fault: Send a SIGBUS to user process always for hwpoison page access. Message-ID: <20210311091941.45790fcf@alex-virtual-machine> In-Reply-To: <047D5B49-FDBB-494C-81E9-DA811476747D@amacapital.net> References: <4fc1b4e8f1fb4c8c81f280db09178797@intel.com> <047D5B49-FDBB-494C-81E9-DA811476747D@amacapital.net> 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: 8BIT 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: H4sIAAAAAAAAA+NgFlrBIsWRmVeSWpSXmKPExsXCFcGooLsqwzPBYMZZIYvPG/6xWbzY0M5o MW2juMXm7x1sFpd3zWGzuLfmP6vF6rUNrBbnd61ltbh0YAGTxcXGA4wWW/e3Mloc7z3AZLF5 01RmizcX7rFY/NjwmNWB3+N7ax+Lx/03f1k8Nq/Q8li85yWTx6ZVnWwemz5NYvd4d+4cu8e8 k4EeL65uZPF4v+8qm8fnTXIeJ1q+sAbwRHHZpKTmZJalFunbJXBlnLptXvCWp+LWpNPsDYwt XF2MnBwSAiYSb96uZ+xi5OIQEpjOJLG9dSkTSEJI4BWjxLxjoSA2i4CqxImV8xlBbDYge9e9 WawgtoiApsTLKfNZQJqZBU6zSLTt6QYrEhZIljgz6QGYzStgJfFs11k2EJtTwEni/M9PQA0c QAsKJKafCAEJ8wuISfRe+c8EcZC9RNuWRVCtghInZz5hAbGZgXa1bv/NDmFrSyxb+JoZ4k5F icNLfrFD9CpJHOmewQZhx0osm/eKdQKj8Cwko2YhGTULyagFjMyrGFmKc9ONNjFCIjN0B+OM po96hxiZOBgPMUpwMCuJ8Podd0sQ4k1JrKxKLcqPLyrNSS0+xCjNwaIkzrv3mGuCkEB6Yklq dmpqQWoRTJaJg1OqgUnQSUF4Voulk8S9KR7SZsJCB/Pd1lufniYo3ZeZE/pGZ9+8rdlMc/pq PDoDJ898IVhkrh3iymBRyuAXmmde1PtzmTLPl7j0O9tP8ShbWU7/93Tmottf/u7OSbSaaKFV NE/aV6P8dtEGo+KjV529jc5NeihZsqnp7P7qjnU+56tcz6ckeE56qDevpj5zdfmSDX5ztV5O bhDwYwzVM7Psk72SHGcUeK2PK8JTbL12mMFBof8fruWLmZ6NkAu+feHhYoboRdcPPfOJyPbK yFTSeM/yqsUzUr0j+A1zfPbn1ybp0/4JCTBHzt1enJl/h6nc/Duf/BOXc2e0J7eeD558h709 Xnk2z7fzD1N85xUpsRRnJBpqMRcVJwIA7iPl1zsDAAA= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Mar 2021 11:00:28 -0800 Andy Lutomirski wrote: > > On Mar 8, 2021, at 10:31 AM, Luck, Tony wrote: > > > >  > >> > >> Can you point me at that SIGBUS code in a current kernel? > > > > It is in kill_me_maybe(). mce_vaddr is setup when we disassemble whatever get_user() > > or copy from user variant was in use in the kernel when the poison memory was consumed. > > > > if (p->mce_vaddr != (void __user *)-1l) { > > force_sig_mceerr(BUS_MCEERR_AR, p->mce_vaddr, PAGE_SHIFT); > > Hmm. On the one hand, no one has complained yet. On the other hand, hardware that supports this isn’t exactly common. > > We may need some actual ABI design here. We also need to make sure that things like io_uring accesses or, more generally, anything using the use_mm / use_temporary_mm ends up either sending no signal or sending a signal to the right target. > > > > > Would it be any better if we used the BUS_MCEERR_AO code that goes into siginfo? > > Dunno. I have one thought here but don't know if it's proper: Previous patch use force_sig_mceerr to the user process for such a scenario; with this method The SIGBUS can't be ignored as force_sig_mceerr() was designed to. If the user process don't want this signal, will it set signal config to ignore? Maybe we can use a send_sig_mceerr() instead of force_sig_mceerr(), if process want to ignore the SIGBUS, then it will ignore that, or it can also process the SIGBUS? -- Thanks! Aili Yao