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/scsi/cd.c | |
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/scsi/cd.c')
-rw-r--r-- | sys/scsi/cd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index d47653d3ca1..6ccba930625 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.137 2008/06/10 20:27:31 art Exp $ */ +/* $OpenBSD: cd.c,v 1.138 2008/06/15 00:36:41 krw Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -483,8 +483,7 @@ cdstrategy(struct buf *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, cd->sc_dk.dk_label, + if (bounds_check_with_label(bp, cd->sc_dk.dk_label, (cd->flags & (CDF_WLABEL|CDF_LABELLING)) != 0) <= 0) goto done; |