summaryrefslogtreecommitdiffstats
path: root/sys/dev/flash.c
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/flash.c
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/flash.c')
-rw-r--r--sys/dev/flash.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/flash.c b/sys/dev/flash.c
index abce68b529f..c6ea5ccb26b 100644
--- a/sys/dev/flash.c
+++ b/sys/dev/flash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flash.c,v 1.8 2007/06/20 18:15:46 deraadt Exp $ */
+/* $OpenBSD: flash.c,v 1.9 2008/06/15 00:36:41 krw Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org>
@@ -809,8 +809,7 @@ flashstrategy(struct buf *bp)
goto done;
/* Do bounds checking on partitions. */
- if (flashpart(bp->b_dev) != RAW_PART &&
- bounds_check_with_label(bp, sc->sc_dk.dk_label, 0) <= 0)
+ if (bounds_check_with_label(bp, sc->sc_dk.dk_label, 0) <= 0)
goto done;
/* Queue the transfer. */