mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
exfat: check return value of sb_min_blocksize in exfat_read_boot_sector
commitf2c1f63163upstream. sb_min_blocksize() may return 0. Check its return value to avoid accessing the filesystem super block when sb->s_blocksize is 0. Cc: stable@vger.kernel.org # v6.15 Fixes:719c1e1829("exfat: add super block operations") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com> Link: https://patch.msgid.link/20251104125009.2111925-3-yangyongpeng.storage@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
94acf4082b
commit
93c8a03a10
@@ -452,7 +452,10 @@ static int exfat_read_boot_sector(struct super_block *sb)
|
|||||||
struct exfat_sb_info *sbi = EXFAT_SB(sb);
|
struct exfat_sb_info *sbi = EXFAT_SB(sb);
|
||||||
|
|
||||||
/* set block size to read super block */
|
/* set block size to read super block */
|
||||||
sb_min_blocksize(sb, 512);
|
if (!sb_min_blocksize(sb, 512)) {
|
||||||
|
exfat_err(sb, "unable to set blocksize");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
/* read boot sector */
|
/* read boot sector */
|
||||||
sbi->boot_bh = sb_bread(sb, 0);
|
sbi->boot_bh = sb_bread(sb, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user