]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
gfs2: Fix inode height consistency check
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 27 Mar 2023 22:43:16 +0000 (00:43 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 9 Aug 2023 09:37:56 +0000 (11:37 +0200)
commit1c64bbafe650e1fb7b50c14aedfea0278060d274
tree9049afa596a2f5fd33ee9a40b5de6fa235a72922
parentae459a475b60f8b0465b0dd33cba6a3133292b05
gfs2: Fix inode height consistency check

BugLink: https://bugs.launchpad.net/bugs/2028808
[ Upstream commit cfcdb5bad34f600aed7613c3c1a5e618111f77b7 ]

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: syzbot+45d4691b1ed3c48eba05@syzkaller.appspotmail.com
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/gfs2/glops.c