From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Google Big Sleep
<big-sleep-vuln-reports+bigsleep-501448199@google.com>,
Jens Axboe <axboe@kernel.dk>, Jan Kara <jack@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 6.18.y] mm: call ->free_folio() directly in folio_unmap_invalidate()
Date: Thu, 30 Apr 2026 20:53:00 -0400 [thread overview]
Message-ID: <20260430160000.item002-6.18@kernel.org> (raw)
In-Reply-To: <20260429172222.1401701-1-willy@infradead.org>
On Wed, Apr 29, 2026 at 06:22:22PM +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.
Thanks, queued for 6.18.y.
--
Thanks,
Sasha
prev parent reply other threads:[~2026-05-01 0:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 13:09 FAILED: patch "[PATCH] mm: call ->free_folio() directly in folio_unmap_invalidate()" failed to apply to 6.18-stable tree gregkh
2026-04-20 14:53 ` [PATCH 6.18.y] mm: call ->free_folio() directly in folio_unmap_invalidate() Matthew Wilcox (Oracle)
2026-04-23 8:57 ` Greg KH
2026-04-23 8:59 ` Greg KH
2026-04-27 16:55 ` Matthew Wilcox
2026-04-29 17:22 ` Matthew Wilcox (Oracle)
2026-05-01 0:53 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260430160000.item002-6.18@kernel.org \
--to=sashal@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=big-sleep-vuln-reports+bigsleep-501448199@google.com \
--cc=jack@suse.cz \
--cc=stable@vger.kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.