ext2: Check block size validity during mount
authorJan Kara <jack@suse.cz>
Wed, 1 Mar 2023 10:59:39 +0000 (11:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:36 +0000 (17:32 +0100)
commite6f4fb28890c1361e0db9eb1adee3fc04e7fe7f5
tree7974772024abb529ac859b6abf73b6b5586eda8e
parentf8a6c53ff1d91acd5a20eb627edbffd816eb9a4e
ext2: Check block size validity during mount

[ Upstream commit 62aeb94433fcec80241754b70d0d1836d5926b0a ]

Check that log of block size stored in the superblock has sensible
value. Otherwise the shift computing the block size can overflow leading
to undefined behavior.

Reported-by: syzbot+4fec412f59eba8c01b77@syzkaller.appspotmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext2/ext2.h
fs/ext2/super.c