Re: [syzbot] [fs?] BUG: unable to handle kernel NULL pointer dereference in filemap_read_folio (4)

From: Hillf Danton
Date: Sat Nov 16 2024 - 19:18:46 EST


On Sat, 16 Nov 2024 15:40:29 -0800
> syzbot found the following issue on:
>
> HEAD commit: 3022e9d00ebe Merge tag 'sched_ext-for-6.12-rc7-fixes' of g..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=159f8ce8580000

#syz test

--- x/mm/filemap.c
+++ y/mm/filemap.c
@@ -3781,6 +3781,8 @@ static struct folio *do_read_cache_folio

if (!filler)
filler = mapping->a_ops->read_folio;
+ if (!filler)
+ return ERR_PTR(-EINVAL);
repeat:
folio = filemap_get_folio(mapping, index);
if (IS_ERR(folio)) {
--