Commit 3feef425 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by sanglipeng
Browse files

gfs2: Fix inode height consistency check

stable inclusion
from stable-v5.10.181
commit 4c2c8f959984e8dbbfdb6441b33fb72609eaefc0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8GJZJ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4c2c8f959984e8dbbfdb6441b33fb72609eaefc0



--------------------------------

[ Upstream commit cfcdb5ba ]

The maximum allowed height of an inode's metadata tree depends on the
filesystem block size; it is lower for bigger-block filesystems.  When
reading in an inode, make sure that the height doesn't exceed the
maximum allowed height.

Arrays like sd_heightsize are sized to be big enough for any filesystem
block size; they will often be slightly bigger than what's needed for a
specific filesystem.

Reported-by: default avatar <syzbot+45d4691b1ed3c48eba05@syzkaller.appspotmail.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent b12ae905
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment