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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99A97C433F5 for ; Tue, 5 Apr 2022 02:00:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E9536B0071; Mon, 4 Apr 2022 21:51:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 54A9F6B0098; Mon, 4 Apr 2022 21:51:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C3546B0099; Mon, 4 Apr 2022 21:51:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 262F66B0071 for ; Mon, 4 Apr 2022 21:51:37 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DA9F9A8683 for ; Tue, 5 Apr 2022 01:51:26 +0000 (UTC) X-FDA: 79321148172.20.5AA11E1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf25.hostedemail.com (Postfix) with ESMTP id 6B1D9A0010 for ; Tue, 5 Apr 2022 01:51:26 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 89DD560DDD; Tue, 5 Apr 2022 01:51:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B523FC2BBE4; Tue, 5 Apr 2022 01:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1649123485; bh=FUZOU/Zn0+hZCBwK2e+4+p0g7CLULnGx2JfDvAvsADs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IpU2thuQeNKvYD6CYRgqr/cFuvGZb+Tpddf2ICMSZSIViQJXCFZVasjVw4SdeRjtt 31SDzw45/X1ijxvol2oA981Bgm0i6wvclpyzHJJG+j3PZOdD7plY8fD2ffvO/H2cjW qXsjUWT/q4xsdAYI3mzSeGskOsTX8W8VwUnMLOgY= Date: Mon, 4 Apr 2022 18:51:23 -0700 From: Andrew Morton To: HORIGUCHI =?UTF-8?B?TkFPWUE=?=(=?UTF-8?B?5aCA5Y+j44CA55u05Lmf?=) Cc: Naoya Horiguchi , "linux-mm@kvack.org" , Mike Kravetz , Miaohe Lin , Yang Shi , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v6] mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb() Message-Id: <20220404185123.5be4389d99a0e4665a775da1@linux-foundation.org> In-Reply-To: <20220405014544.GA2583652@hori.linux.bs1.fc.nec.co.jp> References: <20220404092131.751733-1-naoya.horiguchi@linux.dev> <20220404115333.8cf80b9d3a7a55993ed60c57@linux-foundation.org> <20220405014544.GA2583652@hori.linux.bs1.fc.nec.co.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6B1D9A0010 X-Stat-Signature: bmf8rsbcop7rna1p1xk4fywc8ct1nizt X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=IpU2thuQ; dmarc=none; spf=pass (imf25.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1649123486-597083 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, 5 Apr 2022 01:45:45 +0000 HORIGUCHI NAOYA(=E5=A0=80=E5=8F=A3=E3=80= =80=E7=9B=B4=E4=B9=9F) wrote: > On Mon, Apr 04, 2022 at 11:53:33AM -0700, Andrew Morton wrote: > > On Mon, 4 Apr 2022 18:21:31 +0900 Naoya Horiguchi wrote: > >=20 > > > There is a race condition between memory_failure_hugetlb() and huge= tlb > > > free/demotion, which causes setting PageHWPoison flag on the wrong = page. > > > The one simple result is that wrong processes can be killed, but an= other > > > (more serious) one is that the actual error is left unhandled, so n= o one > > > prevents later access to it, and that might lead to more serious re= sults > > > like consuming corrupted data. > >=20 > > Should this fix be backported into stable kernels? >=20 > This is a bug fix, so eligible to send to stable. But I thought that th= is > patch is larger than 100 lines (and hard to separeter to finer patches)= , > which seems to violate the rule stated in > Documentation/process/stable-kernel-rules.rst. >=20 > But actually this rule might not be strictly applied (some patches in > v5.16.y do have more than 100 lines diff...). So if we can ignore this = rule > exceptionally, that's OK and I'll add CC to stable again. I never actually knew about that rule ;) Thanks, I added the cc:stable. > The target commit of Fixed: tag is 761ad8d7c7b5 ("mm: hwpoison: introdu= ce > memory_failure_hugetlb()") which was introduced in 4.13, so most of act= ive > stable trees are affected. Oh. That's good to know. The original patch didn't have a Fixes: line. I added that as well.