]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Dec 2025 10:43:20 +0000 (11:43 +0100)
commit e106e269c5cb38315eb0a0e7e38f71e9b20c8c66 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/isofs/inode.c

index 33e6a620c103e0ae6e7dc7dbdcbada2c451bb4e1..2b1f56fdde2499dcfdcc37983c0fba1c1300af1d 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;