]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: correct grp validation in ext4_mb_good_group
authorKemeng Shi <shikemeng@huaweicloud.com>
Tue, 1 Aug 2023 14:31:55 +0000 (22:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:21 +0000 (09:48 +0200)
commit83a9d5f5ec7e75640b1ba0bbd77a4888df798bb4
tree6de3c3d5eef08b01053ab68e7574d347b8517583
parentcfc5b2ad57fc932c98d0f3bb360d31f446f26959
ext4: correct grp validation in ext4_mb_good_group

[ Upstream commit a9ce5993a0f5c0887c8a1b4ffa3b8046fbcfdc93 ]

Group corruption check will access memory of grp and will trigger kernel
crash if grp is NULL. So do NULL check before corruption check.

Fixes: 5354b2af3406 ("ext4: allow ext4_get_group_info() to fail")
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20230801143204.2284343-2-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/mballoc.c