summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-01-22 01:06:29 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-01-22 01:06:29 +0000
commit7e52a2ecb17e4a58b9d5dc2cd1fa7e09341d10f2 (patch)
tree17cfc87e4b2730a4798ea81eeb0a0fc20195a6bc
parentd19024eea5a3a67f907af21bc58a0ba16091ad57 (diff)
Call checkdisklabel() for labels built from native info. This will
ensure 'c' always has the correct size as the rest of the kernel assumes. Thus prevent dd'ing causing a SCSI out-of-bounds error. ok miod@
-rw-r--r--sys/arch/luna88k/luna88k/disksubr.c4
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c4
-rw-r--r--sys/arch/sparc/sparc/disksubr.c4
-rw-r--r--sys/arch/sparc64/sparc64/disksubr.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/sys/arch/luna88k/luna88k/disksubr.c b/sys/arch/luna88k/luna88k/disksubr.c
index 44b5b849cbb..b91f4288720 100644
--- a/sys/arch/luna88k/luna88k/disksubr.c
+++ b/sys/arch/luna88k/luna88k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.37 2008/06/29 20:05:22 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.38 2009/01/22 01:06:28 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.12 2002/02/19 17:09:44 wiz Exp $ */
/*
@@ -311,7 +311,7 @@ disklabel_om_to_bsd(struct sun_disklabel *sl, struct disklabel *lp)
lp->d_checksum = 0;
lp->d_checksum = dkcksum(lp);
- return (NULL);
+ return (checkdisklabel(lp, lp));
}
/*
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index da0ebc88ffc..2ddee1fc2e4 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.55 2008/06/12 06:58:35 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.56 2009/01/22 01:06:28 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */
/*
@@ -318,7 +318,7 @@ read_mac_label(char *dlbuf, struct disklabel *lp)
lp->d_checksum = 0;
lp->d_checksum = dkcksum(lp);
free(pmap, M_DEVBUF);
- return NULL;
+ return (checkdisklabel(lp, lp));
}
/*
diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c
index 3b995f567d9..b13058af679 100644
--- a/sys/arch/sparc/sparc/disksubr.c
+++ b/sys/arch/sparc/sparc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.76 2008/06/29 20:05:22 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.77 2009/01/22 01:06:28 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */
/*
@@ -384,7 +384,7 @@ disklabel_sun_to_bsd(struct sun_disklabel *sl, struct disklabel *lp)
lp->d_checksum = 0;
lp->d_checksum = dkcksum(lp);
- return (NULL);
+ return (checkdisklabel(lp, lp));
}
/*
diff --git a/sys/arch/sparc64/sparc64/disksubr.c b/sys/arch/sparc64/sparc64/disksubr.c
index 08f6448128a..8532661f77e 100644
--- a/sys/arch/sparc64/sparc64/disksubr.c
+++ b/sys/arch/sparc64/sparc64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.52 2008/06/29 20:05:22 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.53 2009/01/22 01:06:28 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk Exp $ */
/*
@@ -377,7 +377,7 @@ disklabel_sun_to_bsd(struct sun_disklabel *sl, struct disklabel *lp)
lp->d_checksum = 0;
lp->d_checksum = dkcksum(lp);
- return (NULL);
+ return (checkdisklabel(lp, lp));
}
/*