Skip to content

Commit d5e72c4

Browse files
committed
ext4: fix lost error code reporting in __ext4_fill_super()
When code was factored out of __ext4_fill_super() into ext4_percpu_param_init() the error return was discarded. This meant that it was possible for __ext4_fill_super() to return zero, indicating success, without the struct super getting completely filled in, leading to a potential NULL pointer dereference. Reported-by: syzbot+bbf0f9a213c94f283a5c@syzkaller.appspotmail.com Fixes: 1f79467 ("ext4: factor out ext4_percpu_param_init() ...") Link: https://syzkaller.appspot.com/bug?id=6dac47d5e58af770c0055f680369586ec32e144c Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jason Yan <yanaijie@huawei.com>
1 parent 856dd6c commit d5e72c4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/ext4/super.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5502,7 +5502,8 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
55025502
sbi->s_journal->j_commit_callback =
55035503
ext4_journal_commit_callback;
55045504

5505-
if (ext4_percpu_param_init(sbi))
5505+
err = ext4_percpu_param_init(sbi);
5506+
if (err)
55065507
goto failed_mount6;
55075508

55085509
if (ext4_has_feature_flex_bg(sb))

0 commit comments

Comments
 (0)