summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2023-12-01 16:23:04 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2023-12-01 16:23:04 +0000
commit6525e87618bbe28980ee35bd022d5125f964f427 (patch)
tree20da6a928c1b644c99cd5b206cf54b54b45989a1 /usr.sbin
parent79bfbb1f7b40023e6734a64726ea32264ed253b2 (diff)
Make sure we read a complete struct fsinfo even if the filesystem sectors
are smaller. bug report and ok kn@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/makefs/msdos/msdosfs_vfsops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/makefs/msdos/msdosfs_vfsops.c b/usr.sbin/makefs/msdos/msdosfs_vfsops.c
index 237cd392f59..f00bf9ad177 100644
--- a/usr.sbin/makefs/msdos/msdosfs_vfsops.c
+++ b/usr.sbin/makefs/msdos/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.13 2021/10/06 00:40:41 deraadt Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.14 2023/12/01 16:23:03 miod Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -278,7 +278,8 @@ msdosfs_mount(struct mkfsvnode *devvp, int flags)
DPRINTF(("%s(bread %lu)\n", __func__,
(unsigned long)de_bn2kb(pmp, pmp->pm_fsinfo)));
if ((error = bread(devvp, de_bn2kb(pmp, pmp->pm_fsinfo),
- pmp->pm_BytesPerSec, 0, &bp)) != 0)
+ roundup(sizeof(struct fsinfo), pmp->pm_BytesPerSec),
+ 0, &bp)) != 0)
goto error_exit;
fp = (struct fsinfo *)bp->b_data;
if (!memcmp(fp->fsisig1, "RRaA", 4)