summaryrefslogtreecommitdiffstats
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2008-06-15 00:36:40 +0000
committerkrw <krw@openbsd.org>2008-06-15 00:36:40 +0000
commit2307e81a18d90bcd6ca4b8a63fee943a5d76a54c (patch)
tree5ffa433b647b4ee397fca81c0d0b66b6c5ec5252 /sys/dev/raidframe
parentEnsure that when using the ACPI tables the RVO field is initialized from the ctrl value. (diff)
downloadwireguard-openbsd-2307e81a18d90bcd6ca4b8a63fee943a5d76a54c.tar.xz
wireguard-openbsd-2307e81a18d90bcd6ca4b8a63fee943a5d76a54c.zip
Don't bypass partition bounds check for RAW_PART. We now guarantee that
RAW_PART will always be 0 -> disksize, so the bounds check will always pass for i/o's to valid addresses. Now the i/o will be properly truncated if it goes past the end of the device. This prevents various adverse impacts of issuing i/o's for data past the end of the device. Repeatedly requested by todd@. ok weingart@ deraadt@
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_openbsdkintf.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/dev/raidframe/rf_openbsdkintf.c b/sys/dev/raidframe/rf_openbsdkintf.c
index 385a8c5f4f5..d691a0f84fa 100644
--- a/sys/dev/raidframe/rf_openbsdkintf.c
+++ b/sys/dev/raidframe/rf_openbsdkintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_openbsdkintf.c,v 1.47 2008/03/26 00:48:54 krw Exp $ */
+/* $OpenBSD: rf_openbsdkintf.c,v 1.48 2008/06/15 00:36:41 krw Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */
/*-
@@ -768,13 +768,12 @@ raidstrategy(struct buf *bp)
* error, the bounds check will flag that for us.
*/
wlabel = rs->sc_flags & (RAIDF_WLABEL | RAIDF_LABELLING);
- if (DISKPART(bp->b_dev) != RAW_PART)
- if (bounds_check_with_label(bp, lp, wlabel) <= 0) {
- db1_printf(("Bounds check failed!!:%d %d\n",
- (int)bp->b_blkno, (int)wlabel));
- biodone(bp);
- goto raidstrategy_end;
- }
+ if (bounds_check_with_label(bp, lp, wlabel) <= 0) {
+ db1_printf(("Bounds check failed!!:%d %d\n",
+ (int)bp->b_blkno, (int)wlabel));
+ biodone(bp);
+ goto raidstrategy_end;
+ }
bp->b_resid = 0;