1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-24 01:09:38 -05:00
linux/fs/nilfs2
Ryusuke Konishi a9e1ddc09c nilfs2: fix kernel bug on rename operation of broken directory
Syzbot reported that in rename directory operation on broken directory on
nilfs2, __block_write_begin_int() called to prepare block write may fail
BUG_ON check for access exceeding the folio/page size.

This is because nilfs_dotdot(), which gets parent directory reference
entry ("..") of the directory to be moved or renamed, does not check
consistency enough, and may return location exceeding folio/page size for
broken directories.

Fix this issue by checking required directory entries ("." and "..") in
the first chunk of the directory in nilfs_dotdot().

Link: https://lkml.kernel.org/r/20240628165107.9006-1-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: syzbot+d3abed1ad3d367fa2627@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d3abed1ad3d367fa2627
Fixes: 2ba466d74e ("nilfs2: directory entry operations")
Tested-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-07-03 22:40:38 -07:00
..
alloc.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 12:29:25 -07:00
alloc.h nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 12:29:25 -07:00
bmap.c
bmap.h
btnode.c
btnode.h
btree.c
btree.h
cpfile.c
cpfile.h
dat.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 12:29:25 -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 12:29:25 -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 12:29:24 -07:00
page.c
page.h
recovery.c nilfs2: make block erasure safe in nilfs_finish_roll_forward() 2024-05-19 14:36:21 -07:00
segbuf.c
segbuf.h
segment.c nilfs2: fix potential kernel bug due to lack of writeback flag waiting 2024-06-05 19:19:24 -07:00
segment.h
sufile.c
sufile.h
super.c
sysfs.c
sysfs.h
the_nilfs.c nilfs2: fix inode number range checks 2024-07-03 12:29:24 -07:00
the_nilfs.h nilfs2: fix inode number range checks 2024-07-03 12:29:24 -07:00