android_kernel_motorola_sm6375/fs/nilfs2
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryusuke Konishi 24c1c8566a nilfs2: fix kernel bug on rename operation of broken directory
commit a9e1ddc09ca55746079cc479aa3eb6411f0d99d4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-18 11:40:56 +02:00
..
alloc.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-18 11:40:52 +02:00
alloc.h nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-18 11:40:52 +02:00
bmap.c nilfs2: fix infinite loop in nilfs_mdt_get_block() 2023-05-17 11:35:54 +02:00
bmap.h
btnode.c nilfs2: fix incomplete buffer cleanup in nilfs_btnode_abort_change_key() 2023-06-21 15:44:10 +02:00
btnode.h
btree.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
btree.h
cpfile.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
cpfile.h
dat.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-18 11:40:52 +02:00
dat.h
dir.c nilfs2: fix kernel bug on rename operation of broken directory 2024-07-18 11:40:56 +02:00
direct.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
direct.h
export.h
file.c nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() 2024-02-23 08:25:12 +01:00
gcinode.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
ifile.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-18 11:40:52 +02:00
ifile.h
inode.c nilfs2: prevent kernel bug at submit_bh_wbc() 2024-04-13 12:51:28 +02:00
ioctl.c nilfs2: fix out-of-range warning 2024-06-16 13:28:32 +02:00
Kconfig
Makefile
mdt.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
mdt.h
namei.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
nilfs.h nilfs2: add missing check for inode numbers on directory entries 2024-07-18 11:40:51 +02:00
page.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
page.h
recovery.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
segbuf.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
segbuf.h
segment.c nilfs2: fix potential kernel bug due to lack of writeback flag waiting 2024-07-05 09:08:19 +02:00
segment.h
sufile.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
sufile.h
super.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
sysfs.c nilfs2: use a more common logging style 2024-04-13 12:51:27 +02:00
sysfs.h
the_nilfs.c nilfs2: fix inode number range checks 2024-07-18 11:40:51 +02:00
the_nilfs.h nilfs2: fix inode number range checks 2024-07-18 11:40:51 +02:00