]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: return error code when ext4_fill_flex_info() fails
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 10 May 2021 11:10:51 +0000 (19:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:15:40 +0000 (16:15 +0200)
commit5485fe228f9771190de24f8936c43879fa52fc25
tree3bfa3587863b3ab86b352f8ab6c0d6800bc673ec
parent9ed3a3d3a8d2cbe99d9e4386a98856491f0eade0
ext4: return error code when ext4_fill_flex_info() fails

commit 8f6840c4fd1e7bd715e403074fb161c1a04cda73 upstream.

After commit c89128a00838 ("ext4: handle errors on
ext4_commit_super"), 'ret' may be set to 0 before calling
ext4_fill_flex_info(), if ext4_fill_flex_info() fails ext4_mount()
doesn't return error code, it makes 'root' is null which causes crash
in legacy_get_tree().

Fixes: c89128a00838 ("ext4: handle errors on ext4_commit_super")
Reported-by: Hulk Robot <hulkci@huawei.com>
Cc: <stable@vger.kernel.org> # v4.18+
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210510111051.55650-1-yangyingliang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/super.c