Re: [PATCH] mm/filemap: fix NULL pointer dereference in do_read_cache_folio()

From: Christoph Hellwig

Date: Tue Nov 18 2025 - 00:05:42 EST


On Sun, Nov 16, 2025 at 10:32:12PM +0000, Matthew Wilcox wrote:
> I don't think it's necessarily all that hard to make buildid work
> for DAX. It's probably something like:
>
> if (IS_DAX(file_inode(file)))
> kernel_read(file, buf, count, &pos);
>
> but that's just off the top of my head.

The code should just unconditionally use kernel_read(). Relying
on ->read_folio to just work is only something file system code and
library code called by the file systems can assume.

Something reading ELF headers has no bunsiness poking into this layer.