linux-stable/fs/nilfs2
Ryusuke Konishi 21a87d88c2 nilfs2: fix NULL pointer dereference at nilfs_bmap_lookup_at_level()
If the i_mode field in inode of metadata files is corrupted on disk, it
can cause the initialization of bmap structure, which should have been
called from nilfs_read_inode_common(), not to be called.  This causes a
lockdep warning followed by a NULL pointer dereference at
nilfs_bmap_lookup_at_level().

This patch fixes these issues by adding a missing sanitiy check for the
i_mode field of metadata file's inode.

Link: https://lkml.kernel.org/r/20221002030804.29978-1-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: syzbot+2b32eb36c1a825b7a74c@syzkaller.appspotmail.com
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-10-11 19:05:45 -07:00
..
alloc.c
alloc.h
bmap.c
bmap.h
btnode.c fs/nilfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:33 -06:00
btnode.h fs/nilfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:33 -06:00
btree.c fs/nilfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:33 -06:00
btree.h
cpfile.c
cpfile.h
dat.c nilfs2: fix lockdep warnings during disk space reclamation 2022-04-01 11:46:09 -07:00
dat.h
dir.c nilfs2: Remove check for PageError 2022-06-29 08:51:07 -04:00
direct.c
direct.h
export.h
file.c
gcinode.c fs/nilfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:33 -06:00
ifile.c
ifile.h
inode.c nilfs2: fix NULL pointer dereference at nilfs_bmap_lookup_at_level() 2022-10-11 19:05:45 -07:00
ioctl.c block: add a bdev_discard_granularity helper 2022-04-17 19:49:59 -06:00
Kconfig
Makefile
mdt.c fs/nilfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:33 -06:00
mdt.h nilfs2: fix lockdep warnings during disk space reclamation 2022-04-01 11:46:09 -07:00
namei.c
nilfs.h nilfs2: fix incorrect masking of permission flags for symlinks 2022-07-03 15:42:33 -07:00
page.c nilfs2: Convert nilfs_copy_back_pages() to use filemap_get_folios() 2022-06-29 08:51:06 -04:00
page.h nilfs2: get rid of nilfs_mapping_init() 2022-04-01 11:46:09 -07:00
recovery.c fs: Remove aop flags parameter from block_write_begin() 2022-05-08 14:28:19 -04:00
segbuf.c Merge branch 'akpm' (patches from Andrew) 2022-03-22 16:11:53 -07:00
segbuf.h
segment.c nilfs2: fix lockdep warnings in page operations for btree nodes 2022-04-01 11:46:09 -07:00
segment.h
sufile.c block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD 2022-04-17 19:49:59 -06:00
sufile.h
super.c nilfs2: fix lockdep warnings in page operations for btree nodes 2022-04-01 11:46:09 -07:00
sysfs.c
sysfs.h
the_nilfs.c block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD 2022-04-17 19:49:59 -06:00
the_nilfs.h