Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3963107pxb; Mon, 1 Feb 2021 09:00:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9BTgdyoTjY3jUTFdMQCFl6/1ENVPswY+5GmOArYlunxjcAo7ppJM/lEsFywdcpdUL2Hhj X-Received: by 2002:aa7:d64b:: with SMTP id v11mr18994225edr.16.1612198825555; Mon, 01 Feb 2021 09:00:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612198825; cv=none; d=google.com; s=arc-20160816; b=FKa9qRJHABv0rpkYVnz8pcbQlez6wasTqTD3gfJBXFhQZtZVncFJ6P7vaX7Bogx744 Sk82DZjl9pQYR2Gpu8VUPYq4uj+IlulHXNlra2Ho/615gjtt3iZVVTqicorNUP5J6Isv 0MUof+ur0o4YtmlThMp3Is7je03BpZwwLgBbrkS5DgQABa9ZPlsqeTte3sIqV9LxThNC p510+v353FZJYk/fc/V9sjFi86YfqXk8ChnVsmClSnRwevUj/yEoYerMgXK1l8sJF8Kc VoVGLdEAC225O2AjzxfZRinz1ytV09y0oomTVs0fI2cpD4eUYTBuIFWicHu1yrGJQzij VQCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=v5oBMgFxqX8JG9asJXfig4+CLCpefllLVON2f2uYIT8=; b=suY73+dcgMKpB9EEZFHozmjd5GQQ72Ej1dj3lbBtWexh+n8pkV4fSAkDxZgV9n6epq xi4RjjKaHqL3Lp56hPbyDNlnBh5gvJteXx3Ga1rVYAjF3EBwDnmV4PDPk5d4vdlKRos4 5yEh7JINYmiwPeHdx14gpLFWoODyqMZeWMuoA+cUKmRfrGi8TcKlAetLlYPkPVqz0uf3 UNakmsZQa+J3zH/niUdLaOvsfiNdtDBvhE/aEttk8/UMO2x67IS29FODwwXhSEQQE3k/ u676ifsBruIc5hbRFNAGNaQFfhWOUPdo88/WgCXzeKOyWS6in0In0YpIeL7FtjcMZnma ev2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KBGdGR+K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si1658152ejx.172.2021.02.01.08.59.55; Mon, 01 Feb 2021 09:00:25 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KBGdGR+K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231748AbhBAQ73 (ORCPT + 99 others); Mon, 1 Feb 2021 11:59:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:38988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbhBAQ7X (ORCPT ); Mon, 1 Feb 2021 11:59:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 35F5C64EC0 for ; Mon, 1 Feb 2021 16:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612198722; bh=mwlzY4YmzjklRz2/xfModrOKlPhbTJUiNVyzf9f0nK8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KBGdGR+K+fpQecTd6AxdzmAuvUKuEwcaR5X7SY8mBWPJqHWGPjhmKKMD8b2ULxiDw rkod9P3UrKte1jp6xkSsElRwCeQjCIP86G99SDFP16Elo/KqRT8Y+rLkZp+yvnWiGo BIS4a/OgRIEVwdTmnNM59J/+JZKIG13JockqUek/apDgsndfvjpKUpwX1shjpMxQZR pAwRSwQ3L5kyd+5SRqQz/BUkFMpY1GR0E4FgDyp4wRoSZJbBr9FM68hm1u+i0PdSnE nv4ijv9Txw7uxO4mOQFRtUOzfn455D6ATGmLNM1aFbyIyI3R2eGfDK/Q/gXDTkdtjK dYcoIOdevIRAw== Received: by mail-ed1-f47.google.com with SMTP id s5so6805669edw.8 for ; Mon, 01 Feb 2021 08:58:42 -0800 (PST) X-Gm-Message-State: AOAM5327RKfyQtnanl+9fZyFEr/sqp2FJT47SjTiUSxoJ2EU8+nnpvNU 0h2tFMO2ODcI0IbJxZmP/CmJGNZgO6lnvS9memOL2A== X-Received: by 2002:a05:6402:b30:: with SMTP id bo16mr20278246edb.84.1612198720520; Mon, 01 Feb 2021 08:58:40 -0800 (PST) MIME-Version: 1.0 References: <20210201161749.0e8dc212.yaoaili@kingsoft.com> In-Reply-To: <20210201161749.0e8dc212.yaoaili@kingsoft.com> From: Andy Lutomirski Date: Mon, 1 Feb 2021 08:58:27 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] x86/fault: Send a SIGBUS to user process always for hwpoison page access. To: Aili Yao Cc: Tony Luck , Dave Hansen , Andrew Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , naoya.horiguchi@nec.com, "H. Peter Anvin" , X86 ML , YANGFENG1@kingsoft.com, Linux-MM , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 1, 2021 at 12:17 AM Aili Yao wrote: > > When one page is already hwpoisoned by AO action, process may not be > killed, the process mapping this page may make a syscall include this > page and result to trigger a VM_FAULT_HWPOISON fault, if it's in kernel > mode it may be fixed by fixup_exception. Current code will just return > error code to user process. > > This is not sufficient, we should send a SIGBUS to the process and log > the info to console, as we can't trust the process will handle the error > correctly. Does this happen when one process gets SIGBUSed due to memory failure and another process independently hits the poisoned memory? I'm not entirely convinced that this is a problem. In any case, this patch needs rebasing on top of my big fault series -- as it stands, it's way too difficult to keep track of which paths even call your new code.. And the various signal paths need to be consolidated -- we already have three of them, and the last thing we need is a fourth.