Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a253f38 authored by Anant Thazhemadam's avatar Anant Thazhemadam Committed by Greg Kroah-Hartman
Browse files

gfs2: add validation checks for size of superblock



[ Upstream commit 0ddc5154b24c96f20e94d653b0a814438de6032b ]

In gfs2_check_sb(), no validation checks are performed with regards to
the size of the superblock.
syzkaller detected a slab-out-of-bounds bug that was primarily caused
because the block size for a superblock was set to zero.
A valid size for a superblock is a power of 2 between 512 and PAGE_SIZE.
Performing validation checks and ensuring that the size of the superblock
is valid fixes this bug.

Reported-by: default avatar <syzbot+af90d47a37376844e731@syzkaller.appspotmail.com>
Tested-by: default avatar <syzbot+af90d47a37376844e731@syzkaller.appspotmail.com>
Suggested-by: default avatarAndrew Price <anprice@redhat.com>
Signed-off-by: default avatarAnant Thazhemadam <anant.thazhemadam@gmail.com>
[Minor code reordering.]
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d808c88f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment