[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <beb60661-ff0b-499c-a059-237bcc6a2551@cybernetics.com>
Date: Mon, 8 Sep 2025 15:05:22 -0400
From: Tony Battersby <tonyb@...ernetics.com>
To: Nilesh Javali <njavali@...vell.com>,
GR-QLogic-Storage-Upstream@...vell.com,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: linux-scsi <linux-scsi@...r.kernel.org>, target-devel@...r.kernel.org,
scst-devel@...ts.sourceforge.net,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [SCST PATCH 11/15] scsi: qla2xxx: fix invalid memory access with big
CDBs
This patch applies to the out-of-tree SCST project, not to the Linux
kernel. Apply when importing the upstream patch with the same title.
Signed-off-by: Tony Battersby <tonyb@...ernetics.com>
---
qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c
index 76d3685a4..3c2d59b6f 100644
--- a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c
+++ b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c
@@ -420,16 +420,15 @@ static int sqa_qla2xxx_handle_cmd(scsi_qla_host_t *vha,
TRACE_DBG("sqatgt(%ld/%d): Handling command: length=%d, fcp_task_attr=%d, direction=%d, bidirectional=%d lun=%llx cdb=%x tag=%d cmd %p ulpcmd %p\n",
vha->host_no, vha->vp_idx, data_length, task_codes,
data_dir, bidi, cmd->unpacked_lun,
- atio->u.isp24.fcp_cmnd.cdb[0],
+ cdb[0],
atio->u.isp24.exchange_addr, cmd, cmd->scst_cmd);
cmd->scst_cmd = scst_rx_cmd(scst_sess,
(uint8_t *)&atio->u.isp24.fcp_cmnd.lun,
sizeof(atio->u.isp24.fcp_cmnd.lun),
- atio->u.isp24.fcp_cmnd.cdb,
- sizeof(atio->u.isp24.fcp_cmnd.cdb) +
- (atio->u.isp24.fcp_cmnd.add_cdb_len * 4),
+ cdb,
+ cmd->cdb_len,
SCST_ATOMIC);
if (cmd->scst_cmd == NULL) {
@@ -1552,7 +1551,6 @@ static int sqa_xmit_response(struct scst_cmd *scst_cmd)
scst_to_tgt_dma_dir(scst_cmd_get_data_direction(scst_cmd));
cmd->offset = scst_cmd_get_ppl_offset(scst_cmd);
cmd->scsi_status = scst_cmd_get_status(scst_cmd);
- cmd->cdb = (unsigned char *) scst_cmd_get_cdb(scst_cmd);
cmd->lba = scst_cmd_get_lba(scst_cmd);
cmd->trc_flags |= TRC_XMIT_STATUS;
@@ -1635,7 +1633,6 @@ static int sqa_rdy_to_xfer(struct scst_cmd *scst_cmd)
cmd->dma_data_direction =
scst_to_tgt_dma_dir(scst_cmd_get_data_direction(scst_cmd));
- cmd->cdb = scst_cmd_get_cdb(scst_cmd);
cmd->sg = scst_cmd_get_sg(scst_cmd);
cmd->sg_cnt = scst_cmd_get_sg_cnt(scst_cmd);
cmd->scsi_status = scst_cmd_get_status(scst_cmd);
--
2.43.0
Powered by blists - more mailing lists