summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2009-07-05 19:18:22 +0000
committermiod <miod@openbsd.org>2009-07-05 19:18:22 +0000
commitd45b69432b5e86f0b01e9df5afee2e00fbcd8274 (patch)
treedb6c688e9709129fb9b458ed898ec5ce83b1afe1
parentsync (diff)
downloadwireguard-openbsd-d45b69432b5e86f0b01e9df5afee2e00fbcd8274.tar.xz
wireguard-openbsd-d45b69432b5e86f0b01e9df5afee2e00fbcd8274.zip
Make sure the OpenBSD bounds exclude the first cylinder, which is used
to store the bootblocks. ok deraadt@
-rw-r--r--sys/arch/hp300/hp300/disksubr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/hp300/hp300/disksubr.c b/sys/arch/hp300/hp300/disksubr.c
index c7750499c1f..78f47c9fbd9 100644
--- a/sys/arch/hp300/hp300/disksubr.c
+++ b/sys/arch/hp300/hp300/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.45 2009/06/04 21:13:01 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.46 2009/07/05 19:18:22 miod Exp $ */
/* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */
/*
@@ -62,6 +62,8 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
bp = geteblk((int)lp->d_secsize);
bp->b_dev = dev;
+ DL_SETBSTART(lp, lp->d_secpercyl);
+
/* don't read the on-disk label if we are in spoofed-only mode */
if (spoofonly)
goto done;
@@ -75,7 +77,8 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
goto done;
}
- msg = checkdisklabel(bp->b_data + LABELOFFSET, lp, 0, DL_GETDSIZE(lp));
+ msg = checkdisklabel(bp->b_data + LABELOFFSET, lp,
+ DL_GETBSTART(lp), DL_GETDSIZE(lp));
if (msg == NULL)
goto done;