diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2021-05-10 19:10:51 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-20 16:15:40 +0200 |
commit | 5485fe228f9771190de24f8936c43879fa52fc25 (patch) | |
tree | 3bfa3587863b3ab86b352f8ab6c0d6800bc673ec /fs/ext4/super.c | |
parent | 9ed3a3d3a8d2cbe99d9e4386a98856491f0eade0 (diff) | |
download | linux-stable-5485fe228f9771190de24f8936c43879fa52fc25.tar.gz linux-stable-5485fe228f9771190de24f8936c43879fa52fc25.tar.bz2 linux-stable-5485fe228f9771190de24f8936c43879fa52fc25.zip |
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>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index fe71ffecba68..9ae3b6dd72fe 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4524,6 +4524,7 @@ no_journal: ext4_msg(sb, KERN_ERR, "unable to initialize " "flex_bg meta info!"); + ret = -ENOMEM; goto failed_mount6; } |