[Stgt-devel] [PATCH] iscsi: fix ahs offset

Pete Wyckoff pw
Wed Dec 26 18:19:48 CET 2007


Commit 9c198d43959fb6991815a76f7eb6dcba0b98ff26 introduced a bug by
changing extdata from a void * to a long *.  The pointer addition to
calculate the offset of the AHS in extended CDBs was off by a factor
of 8, leading to memory scribbles.  Fix with an explicit cast.

Signed-off-by: Pete Wyckoff <pw at osc.edu>
---
 usr/iscsi/iscsid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c
index 54386fc..8872818 100644
--- a/usr/iscsi/iscsid.c
+++ b/usr/iscsi/iscsid.c
@@ -1476,7 +1476,7 @@ static int iscsi_scsi_cmd_rx_start(struct iscsi_connection *conn)
 	task->tag = req->itt;
 
 	if (ahs_len) {
-		task->ahs = task->extdata + sizeof(req->cdb);
+		task->ahs = (uint8_t *) task->extdata + sizeof(req->cdb);
 		conn->req.ahs = task->ahs;
 		conn->req.data = task->data;
 	} else if (data_len)
-- 
1.5.3.6




More information about the stgt mailing list