projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63b5aa0
)
exfat: check return value of sb_min_blocksize in exfat_read_boot_sector
author
Yongpeng Yang
<yangyongpeng@xiaomi.com>
Tue, 4 Nov 2025 12:50:07 +0000
(20:50 +0800)
committer
Christian 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
accessing the filesystem super block when sb->s_blocksize is 0.
Cc: stable@vger.kernel.org # v6.15
Fixes:
719c1e1829166d
("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>
fs/exfat/super.c
patch
|
blob
|
history
diff --git
a/fs/exfat/super.c
b/fs/exfat/super.c
index
7f95928
..
74d451f
100644
(file)
--- a/
fs/exfat/super.c
+++ b/
fs/exfat/super.c
@@
-433,7
+433,10
@@
static int exfat_read_boot_sector(struct super_block *sb)
struct exfat_sb_info *sbi = EXFAT_SB(sb);
/* 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 */
sbi->boot_bh = sb_bread(sb, 0);