summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorap25164 <none@none>2006-05-10 11:30:33 -0700
committerap25164 <none@none>2006-05-10 11:30:33 -0700
commita888983f416e22ce3186fbede8c923a1280b763f (patch)
tree81627b31a3b861bb47010309139772703450fc2d /usr/src
parent562de0c06c803358fe939db7021fe5d192e82ca6 (diff)
downloadillumos-joyent-a888983f416e22ce3186fbede8c923a1280b763f.tar.gz
6339695 scsa1394_cmd_fill_cdb_rbc() builds scsi cdbs containing uninitialized data
Contributed by Juergen Keil <jk@tools.de>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/io/1394/targets/scsa1394/hba.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/usr/src/uts/common/io/1394/targets/scsa1394/hba.c b/usr/src/uts/common/io/1394/targets/scsa1394/hba.c
index 3435f0b11a..20addb89d9 100644
--- a/usr/src/uts/common/io/1394/targets/scsa1394/hba.c
+++ b/usr/src/uts/common/io/1394/targets/scsa1394/hba.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -2037,6 +2036,25 @@ scsa1394_cmd_fill_cdb_rbc(scsa1394_lun_t *lp, scsa1394_cmd_t *cmd)
cmd->sc_xfer_bytes = len * blk_size;
/* finalize new CDB */
+ switch (pkt->pkt_cdbp[0]) {
+ case SCMD_READ:
+ case SCMD_WRITE:
+ /*
+ * We rewrite READ/WRITE G0 commands as READ/WRITE G1.
+ * Build new cdb from scatch.
+ * The lba and length fields is updated below.
+ */
+ bzero(cmd->sc_cdb, cmd->sc_cdb_actual_len);
+ break;
+ default:
+ /*
+ * Copy the non lba/len fields.
+ * The lba and length fields is updated below.
+ */
+ bcopy(pkt->pkt_cdbp, cmd->sc_cdb, cmd->sc_cdb_actual_len);
+ break;
+ }
+
cmd->sc_cdb[0] = (uchar_t)opcode;
scsa1394_cmd_fill_cdb_lba(cmd, lba);
switch (opcode) {