Unverified Commit e106e269 authored by Yongpeng Yang's avatar Yongpeng Yang Committed by Christian Brauner
Browse files

isofs: check the return value of sb_min_blocksize() in isofs_fill_super



sb_min_blocksize() may return 0. Check its return value to avoid
opt->blocksize and sb->s_blocksize is 0.

Cc: stable@vger.kernel.org # v6.15
Fixes: 1b17a46c ("isofs: convert isofs to use the new mount API")
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarYongpeng Yang <yangyongpeng@xiaomi.com>
Link: https://patch.msgid.link/20251104125009.2111925-4-yangyongpeng.storage@gmail.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent f2c1f631
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -610,6 +610,11 @@ static int isofs_fill_super(struct super_block *s, struct fs_context *fc)
		goto out_freesbi;
	}
	opt->blocksize = sb_min_blocksize(s, opt->blocksize);
	if (!opt->blocksize) {
		printk(KERN_ERR
		       "ISOFS: unable to set blocksize\n");
		goto out_freesbi;
	}

	sbi->s_high_sierra = 0; /* default is iso9660 */
	sbi->s_session = opt->session;