]> Git Repo - linux.git/commit
nilfs2: fix kernel bug due to missing clearing of checked flag
authorRyusuke Konishi <[email protected]>
Thu, 17 Oct 2024 19:33:10 +0000 (04:33 +0900)
committerAndrew Morton <[email protected]>
Tue, 29 Oct 2024 04:40:40 +0000 (21:40 -0700)
commit41e192ad2779cae0102879612dfe46726e4396aa
tree64c601315a4a1af6d14f093033da9e579b75fd3e
parentd95fb348f0160f562ac07fa201dbbaf14524381f
nilfs2: fix kernel bug due to missing clearing of checked flag

Syzbot reported that in directory operations after nilfs2 detects
filesystem corruption and degrades to read-only,
__block_write_begin_int(), which is called to prepare block writes, may
fail the BUG_ON check for accesses exceeding the folio/page size,
triggering a kernel bug.

This was found to be because the "checked" flag of a page/folio was not
cleared when it was discarded by nilfs2's own routine, which causes the
sanity check of directory entries to be skipped when the directory
page/folio is reloaded.  So, fix that.

This was necessary when the use of nilfs2's own page discard routine was
applied to more than just metadata files.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 8c26c4e2694a ("nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption")
Signed-off-by: Ryusuke Konishi <[email protected]>
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=d6ca2daf692c7a82f959
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
fs/nilfs2/page.c
This page took 0.055026 seconds and 4 git commands to generate.