]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nilfs2: reject invalid file types when reading inodes
authorRyusuke Konishi <konishi.ryusuke@gmail.com>
Thu, 10 Jul 2025 13:49:08 +0000 (22:49 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:04:49 +0000 (12:04 +0200)
commit1a5c204e175a78556b8ef1f7683249fa5197295a
treeadfda57a5b41789501477df465c1b41faf16e373
parent048b8577e645d26502308d9936be09f3ceafc47f
nilfs2: reject invalid file types when reading inodes

commit 4aead50caf67e01020c8be1945c3201e8a972a27 upstream.

To prevent inodes with invalid file types from tripping through the vfs
and causing malfunctions or assertion failures, add a missing sanity check
when reading an inode from a block device.  If the file type is not valid,
treat it as a filesystem error.

Link: https://lkml.kernel.org/r/20250710134952.29862-1-konishi.ryusuke@gmail.com
Fixes: 05fe58fdc10d ("nilfs2: inode operations")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: syzbot+895c23f6917da440ed0d@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=895c23f6917da440ed0d
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nilfs2/inode.c