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 12E36C4167B for ; Wed, 8 Nov 2023 21:48:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7227C8D00C6; Wed, 8 Nov 2023 16:48:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D2E58D0073; Wed, 8 Nov 2023 16:48:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59A2C8D00C6; Wed, 8 Nov 2023 16:48:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4B0F38D0073 for ; Wed, 8 Nov 2023 16:48:29 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 285CE1CB91D for ; Wed, 8 Nov 2023 21:48:29 +0000 (UTC) X-FDA: 81436126338.03.2FA2066 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP id C1F981C0005 for ; Wed, 8 Nov 2023 21:48:26 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ZZeqBfon; spf=none (imf18.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699480107; a=rsa-sha256; cv=none; b=1SU9NNuvRi0g5o1Aeny8rQNbBX4CVmwQws8UimSAmly3pfKipJnWuuc3EfVTlPrXqp/bff AHQkR/FLBsgl7n40y+YtPPhMBH+2N61LSWAbfVVmwV3sGu/OMSyXfLmkSWcBNQDtc2SY7v ZBy46aPwwa5OAy7s6Cqk9HeOeeLuJQw= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ZZeqBfon; spf=none (imf18.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699480107; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=b8NLj0A75vECiKuBG76LMuM8DoRoYCbpAFm9PE4OATA=; b=LVQcr75EbcKdA16hLgZRqFIDsF01sPsR7FZSYCUzYQToiBTAQoCoSr4o3gHs3UAWjjuP89 p8N9e9MjEmToIycbG8SKYyyXB4JXq3CAi2TTkk+C+ljNvf5BGs03pANq4pWAheCgTOKnxe xtM6ltjSO/04ttiDvxVToANtYztSwNY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=b8NLj0A75vECiKuBG76LMuM8DoRoYCbpAFm9PE4OATA=; b=ZZeqBfonCcqvEi+G9NBtIC6djJ Uu3cxaTrNvM3/v1/pvq/oDskntrFwuqw2PJ5dckJXj7ZjUmufYegNKROa4tvivONASNgHFbXoI1or 9+skRzWL713TjsD4t4PIpin7WF93ZpZwRnCBYJIR1M+Vp5J245L/Zc/BMl4388GKC3Oq+k2ZBiYBi Ych/mz0n11wF+tB9kfDVqit+jfrcypb0zyRr/VQ3MYpzUU7jL8xKAQmI+88yTpm9dXQmNZ7R+47xQ mgpk2QraMQlO38pCypexOvygSbPDWpDT7k0rayjVqgWiZXDU8vvhZswd7XcQ96ggBxzooqk9Gieav /l/x5xGA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r0qPM-003O3N-Al; Wed, 08 Nov 2023 21:48:20 +0000 Date: Wed, 8 Nov 2023 21:48:20 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Naoya Horiguchi , linux-mm@kvack.org, stable@vger.kernel.org Subject: Re: [PATCH 2/6] mm: Convert __do_fault() to use a folio Message-ID: References: <20231108182809.602073-1-willy@infradead.org> <20231108182809.602073-3-willy@infradead.org> <20231108130751.f515f0f3c5ce5fb5b1d70fb0@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231108130751.f515f0f3c5ce5fb5b1d70fb0@linux-foundation.org> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C1F981C0005 X-Stat-Signature: tufwh38i6pm487b6kbg86heajxxboc5t X-Rspam-User: X-HE-Tag: 1699480106-958594 X-HE-Meta: U2FsdGVkX1+1yTwpa7mFHlI+3EgblxDVON91pDj2eVBIlwXVmSVll2rQxS2aNRNpwferyd9aG0UfccFsI9ypieKFQgLVhZSW1y6wYUq7L8NR+ydiHXLTJHiR5l6CvzYI66Z8fxp0Ub8SLX+gxaUOW7JG4KAwp7LCLFvWOuY6QMFgjY+PCuvod6Z5stiXTa4n66UwW6tdNgpvpM+MHx9ZiIO3IxHygaxbQB1hMAHNHiE1Ez+eqpB2MM22Eca5SAV18MQOTPOfdbTNxotYMHiFViq0sfLQ4MSABphMcU8BXxHqEVIl2MSeL7Djp/jM63qfnx73yGaXUv6zxZp2/5zve4w3eq8rhZ0juWObSAIxjy4FQAift1QoWgpFZrg0qmWFQU1vJEqiK2wLKXY0DR89gUixRhJt0ZsDPjlpPLfCj/K1cAthy5Y9zqDDk7UdoE0o8lSkDzersGWsWm59VB0sOmrATG+aFxh4N8acWdvK1K/ZDrBwV+h5vOdxiXQnkdn2Mnf+lrW22F0Z+kvmljPb1SL5l0s1UxA3C1dvfDGVZ3eLaqg+gyqVGjEemQCmIXk0hvPirfadFPLUKUJ8IEzUoTa1nFWeS15xeutV/DkyRmakiuYBI8W0wB1iVJhIkqmoNQScjnLrCKKf6294neTOF3EbGFpVaoQ4xuklelwiZexPVP8h2VftOFeP4u+mEBGpj1PL4fdJjXLhWnkZ1Unjg4AJoxzK2ayc1Jfoiv39QGmW1HBVLGzGSYmlcAKR0iXrtdOreIcUQR0Xa/eX4FPrcC+d4HnJ2taNboweWJ3S5mZqTaFyu4KBG1SocGysZngSvezKlb0NSWyjXHZ/g8KlVw+4IgeiqSu+YbQgFCzBQe7Pzxbmo+mLDgUSBxjvu989EEp6CsfgowCVhvXmlvmKT5QEtbJyIp/5NkasRcuANbaJdTn/9f937dz7sZUrqwgtv7hXiOo1xCjPbUTJ3K6 Q5ds1W36 9fJcnGSk64JjD8YOXFKPp4HPqGIGXhAmljjxFNHilYieRjGgAB636Era5z31IrBzAvmHLnnmDhJsxA1RMs7LOLv9u8hR8vZGjSliUmjd8O8jGqpx24Rl6Fhq6l8jTaQjOITkC/AD1lE0To3eIzllk8LxhaxwnvOFJUjrLQXsfqM69FkVuG5slA5esbA7qxYDps84GOowVKLuZwwkhvZ0rqsw2XSd6aX43f3H336/W52MJ5Mo= 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: List-Subscribe: List-Unsubscribe: On Wed, Nov 08, 2023 at 01:07:51PM -0800, Andrew Morton wrote: > On Wed, 8 Nov 2023 18:28:05 +0000 "Matthew Wilcox (Oracle)" wrote: > > > Convert vmf->page to a folio as soon as we're going to use it. This fixes > > a bug if the fault handler returns a tail page with hardware poison; > > tail pages have an invalid page->index, so we would fail to unmap the > > page from the page tables. We actually have to unmap the entire folio (or > > mapping_evict_folio() will > > Would we merely fail to unmap or is there a possibility of unmapping > some random innocent other page? > > How might this bug manifest in userspace, worst case? I think we might unmap a random other page in this file. But then the next fault on that page will bring it back in, so it's only going to be a tiny performance blip. And we've just found a hwpoisoned page which is going to cause all kinds of other excitement, so I doubt it'll be noticed in the grand scheme of things. > As it's cc:stable I'll pluck this patch out of the rest of the series > and shall stage it for 6.7-rcX, via mm-hotfixes-unstable -> > mm-hotfixes-stable -> Linus. Unless this bug is a very minor thing? I think it's minor enough that it can wait for 6.8. Unless anyone disagrees?