]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
isofs: check the return value of sb_min_blocksize() in isofs_fill_super
authorYongpeng Yang <yangyongpeng@xiaomi.com>
Tue, 4 Nov 2025 12:50:08 +0000 (20:50 +0800)
committerChristian Brauner <brauner@kernel.org>
Wed, 5 Nov 2025 13:00:16 +0000 (14:00 +0100)
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>
fs/isofs/inode.c

index 6f0e6b19383c87673b79c686dcc50b09f7d59b6e..ad3143d4066bf693cf60176ebfffc118c69c5085 100644 (file)
@@ -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;