]> git.baikalelectronics.ru Git - kernel.git/commit
ext2: Add more validity checks for inode counts
authorJan Kara <jack@suse.cz>
Tue, 26 Jul 2022 11:13:50 +0000 (13:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:28 +0000 (11:17 +0200)
commit2f55ff8a69cd25904942076e58b879954845b40e
tree7e1b9e3da583ab9f4815677645f97f840352c7ac
parent23803dfcc5ad4c02b8a5275cd6a5a5ea099ca4db
ext2: Add more validity checks for inode counts

[ Upstream commit fd9edb095ce12fab4130757d8b140c6ea59ba672 ]

Add checks verifying number of inodes stored in the superblock matches
the number computed from number of inodes per group. Also verify we have
at least one block worth of inodes per group. This prevents crashes on
corrupted filesystems.

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