kernel-hacking-2024-linux-s.../fs/nilfs2
Ryusuke Konishi 4811f7af60 nilfs2: handle inconsistent state in nilfs_btnode_create_block()
Syzbot reported that a buffer state inconsistency was detected in
nilfs_btnode_create_block(), triggering a kernel bug.

It is not appropriate to treat this inconsistency as a bug; it can occur
if the argument block address (the buffer index of the newly created
block) is a virtual block number and has been reallocated due to
corruption of the bitmap used to manage its allocation state.

So, modify nilfs_btnode_create_block() and its callers to treat it as a
possible filesystem error, rather than triggering a kernel bug.

Link: https://lkml.kernel.org/r/20240725052007.4562-1-konishi.ryusuke@gmail.com
Fixes: a60be987d4 ("nilfs2: B-tree node cache")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: syzbot+89cc4f2324ed37988b60@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=89cc4f2324ed37988b60
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-07-26 14:33:10 -07:00
..
alloc.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 19:30:16 -07:00
alloc.h nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 19:30:16 -07:00
bmap.c nilfs2: drop usage of page_index 2024-07-03 19:29:54 -07:00
bmap.h
btnode.c nilfs2: handle inconsistent state in nilfs_btnode_create_block() 2024-07-26 14:33:10 -07:00
btnode.h
btree.c nilfs2: handle inconsistent state in nilfs_btnode_create_block() 2024-07-26 14:33:10 -07:00
btree.h
cpfile.c
cpfile.h
dat.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 19:30:16 -07:00
dat.h
dir.c nilfs2: fix kernel bug on rename operation of broken directory 2024-07-03 22:40:38 -07:00
direct.c
direct.h
export.h
file.c
gcinode.c
ifile.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 19:30:16 -07:00
ifile.h
inode.c
ioctl.c
Kconfig
Makefile
mdt.c
mdt.h
namei.c
nilfs.h nilfs2: add missing check for inode numbers on directory entries 2024-07-03 19:30:16 -07:00
page.c
page.h
recovery.c
segbuf.c
segbuf.h
segment.c nilfs2: avoid undefined behavior in nilfs_cnt32_ge macro 2024-07-04 23:43:11 -07:00
segment.h
sufile.c
sufile.h
super.c
sysfs.c nilfs2: Constify struct kobj_type 2024-07-12 16:39:52 -07:00
sysfs.h
the_nilfs.c nilfs2: fix inode number range checks 2024-07-03 19:30:15 -07:00
the_nilfs.h nilfs2: fix inode number range checks 2024-07-03 19:30:15 -07:00