[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aRxunCkc4VomEUdo@infradead.org>
Date: Tue, 18 Nov 2025 05:03:24 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Matthew Wilcox <willy@...radead.org>,
"Darrick J. Wong" <djwong@...nel.org>,
SHAURYA RANE <ssrane_b23@...vjti.ac.in>, akpm@...ux-foundation.org,
shakeel.butt@...ux.dev, eddyz87@...il.com, andrii@...nel.org,
ast@...nel.org, linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-kernel-mentees@...ts.linux.dev,
skhan@...uxfoundation.org, david.hunter.linux@...il.com,
khalid@...nel.org,
syzbot+09b7d050e4806540153d@...kaller.appspotmail.com,
bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH] mm/filemap: fix NULL pointer dereference in
do_read_cache_folio()
On Mon, Nov 17, 2025 at 10:45:31AM -0800, Andrii Nakryiko wrote:
> As I replied on another email, ideally we'd have some low-level file
> reading interface where we wouldn't have to know about secretmem, or
> XFS+DAX, or whatever other unusual combination of conditions where
> exposed internal APIs like filemap_get_folio() + read_cache_folio()
> can crash.
The problem is that you did something totally insane and it kinda works
most of the time. But bpf or any other file system consumer has
absolutely not business poking into the page cache to start with.
And I'm really pissed off that you wrote and merged this code without
ever bothering to talk to a FS or MM person who have immediately told
you so. Let's just rip out this buildid junk for now and restart
because the problem isn't actually that easy.
>
> The only real limitation is that we'd like to be able to control
> whether we are ok sleeping or not, as this code can be called from
> pretty much anywhere BPF might run, which includes NMI context.
>
> Would this kiocb_read() approach work under those circumstances?
No. IOCB_NOWAIT is just a hint to avoid blocking function calls.
It is not guarantee and a guarantee is basically impossible.
Powered by blists - more mailing lists