From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C2F925A2A2 for ; Mon, 27 Apr 2026 16:55:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777308949; cv=none; b=rurpsXNblRof0ksY/K7EgJWjS0QU7dhGX+qwKtXMTp4plSjnB/XkPdQ3nDMesY1/y5H592OYaVM6GztmlbcJQdb8CO0sQYK0Po9UdvsuI8OK5M/VnAhHBgJ5R2k9C/NgtRwsr7F+852yIi6JEYguYAEGNk1jx+CVrPgsq1l2MkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777308949; c=relaxed/simple; bh=9NLAnZyvkPxdTiPXgetlc4R2iyg3gn4b0+yqy+0wL68=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HhSuU0MkZhzJh+OBJiGiNaOTPaQFqwIpzX+ITmp5S2+XXLsMbmOrAskjGw/npXNeYrgRdGnAd87OVfJgNh44PJQo+5DR2xeuabrM7eqO9SiCtCwSORD5plX3u7YgP8c3m1uxR4ql1a7EJmwWYrI2nENTW1AIpQZw7w3/Ns1478I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=iXaef73M; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="iXaef73M" 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=e2PbKND2xsOure1JHyNw9mIl9kMp8mBAQlrrVVreNgY=; b=iXaef73MAVRIW6giM+n0p2tFpF k/Gk1psGXRKSUIUP3utYxPLzjdyJ6zgqj8CKiKJsxElWYA+cF44dBInC4sdyhm+5lz8BECGMl/bza NGgho4G5ksjo0IpTkb8Eru/cQAmKN6xSd84pxxxhNovFq9xWnDG2byx+4HpRhqqHhusa/zJhYFy/n Q0qQY/UwPMyDECnrg/rMyEvEMWBTuv/ZVpdB5WAZkKCOkJeZdUb5JyLIWSrrQtGDV2dLytzMxm1QL x64F3KxD2YnfGILlkw0bA7XrdtbZPZGtMFa52n0b1sk3HkqkW+RZ0l17910e00y0v5jPvvGPzBpec SBrawWAw==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1wHPFI-00000002Nnz-1RiC; Mon, 27 Apr 2026 16:55:44 +0000 Date: Mon, 27 Apr 2026 17:55:44 +0100 From: Matthew Wilcox To: Greg KH Cc: stable@vger.kernel.org, Google Big Sleep , Jens Axboe , Jan Kara , Andrew Morton Subject: Re: [PATCH 6.18.y] mm: call ->free_folio() directly in folio_unmap_invalidate() Message-ID: References: <2026042002-idealness-evade-7213@gregkh> <20260420145343.2046992-1-willy@infradead.org> <2026042310-buffoon-wool-f299@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2026042310-buffoon-wool-f299@gregkh> On Thu, Apr 23, 2026 at 10:59:49AM +0200, Greg KH wrote: > On Mon, Apr 20, 2026 at 03:53:43PM +0100, Matthew Wilcox (Oracle) wrote: > > We can only call filemap_free_folio() if we have a reference to (or hold a > > lock on) the mapping. Otherwise, we've already removed the folio from the > > mapping so it no longer pins the mapping and the mapping can be removed, > > causing a use-after-free when accessing mapping->a_ops. > > > > Follow the same pattern as __remove_mapping() and load the free_folio > > function pointer before dropping the lock on the mapping. That lets us > > make filemap_free_folio() static as this was the only caller outside > > filemap.c. > > > > Link: https://lore.kernel.org/20260413184314.3419945-1-willy@infradead.org > > Fixes: fb7d3bc41493 ("mm/filemap: drop streaming/uncached pages when writeback completes") > > Signed-off-by: Matthew Wilcox (Oracle) > > Wait, I see what's wrong, this function isn't even in 6.18.y, which is > why when I apply this it has fuzz and blows up. > > So this isn't going to work at all here, did you send the wrong > backport? Oh blimey. Somehow I did the backport to 6.12.y. Sorry about that; I'll do 6.18 now.