diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-06-15 00:36:42 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-06-15 00:36:42 +0000 |
commit | c74544620cbb68ee5eeb151f8179b7b75a541845 (patch) | |
tree | 690e112486687a73d36279bd6260d0c784473b24 /sys/dev/isa | |
parent | 663dcc3f9fd3820372803855330ae78840ef6eb3 (diff) |
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/isa')
-rw-r--r-- | sys/dev/isa/mcd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/isa/mcd.c b/sys/dev/isa/mcd.c index 7e741776f77..427284806f5 100644 --- a/sys/dev/isa/mcd.c +++ b/sys/dev/isa/mcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mcd.c,v 1.49 2007/06/20 18:15:46 deraadt Exp $ */ +/* $OpenBSD: mcd.c,v 1.50 2008/06/15 00:36:41 krw Exp $ */ /* $NetBSD: mcd.c,v 1.60 1998/01/14 12:14:41 drochner Exp $ */ /* @@ -507,8 +507,7 @@ mcdstrategy(bp) * Do bounds checking, adjust transfer. if error, process. * If end of partition, just return. */ - if (DISKPART(bp->b_dev) != RAW_PART && - bounds_check_with_label(bp, sc->sc_dk.dk_label, + if (bounds_check_with_label(bp, sc->sc_dk.dk_label, (sc->flags & (MCDF_WLABEL|MCDF_LABELLING)) != 0) <= 0) goto done; |