summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongpeng Yang <yangyongpeng@xiaomi.com>2025-11-04 20:50:08 +0800
committerChristian Brauner <brauner@kernel.org>2025-11-05 14:00:16 +0100
commite106e269c5cb38315eb0a0e7e38f71e9b20c8c66 (patch)
tree4d2424de7837977f832212644cde4ba1225c9738
parentf2c1f631630e01821fe4c3fdf6077bc7a8284f82 (diff)
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: 1b17a46c9243e9 ("isofs: convert isofs to use the new mount API") Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com> Link: https://patch.msgid.link/20251104125009.2111925-4-yangyongpeng.storage@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/isofs/inode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 6f0e6b19383c..ad3143d4066b 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -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;