summaryrefslogtreecommitdiffstats
path: root/sys/scsi
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1994-11-03 18:20:15 +0000
committerjoerg <joerg@FreeBSD.org>1994-11-03 18:20:15 +0000
commit4126e5a579f28e0fdc34059000e821a3cc8dab8a (patch)
treeff4ae804b8b9e940c8ab0b1bb59060229a645a18 /sys/scsi
parent24e84e8688253a62208f8f82cefc5652c70bfae8 (diff)
downloadFreeBSD-src-4126e5a579f28e0fdc34059000e821a3cc8dab8a.zip
FreeBSD-src-4126e5a579f28e0fdc34059000e821a3cc8dab8a.tar.gz
|Both, the wd and the sd driver do not reject invalid request of odd
|sizes. They simply pass them to the disks, which usually causes |fatal errors then.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/sd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 2b25099..f30df75 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
- * $Id: sd.c,v 1.38 1994/10/27 20:45:04 jkh Exp $
+ * $Id: sd.c,v 1.39 1994/10/31 23:45:40 phk Exp $
*/
#define SPLSD splbio
@@ -441,6 +441,13 @@ sdstrategy(bp)
goto done;
}
/*
+ * Odd number of bytes
+ */
+ if (bp->b_bcount % DEV_BSIZE != 0) {
+ bp->b_error = EINVAL;
+ goto bad;
+ }
+ /*
* Decide which unit and partition we are talking about
* only raw is ok if no label
*/
OpenPOWER on IntegriCloud