Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mode select: Abort from potential endless loop

Invalid data structure could result in endless loop.
Return with CHECK CONDITION if endless loop detected.

Signed-off-by: Mark Harvey <markh794@gmail.com>
  • Loading branch information...
commit c3f8f32dc91a528c2a7014d526a4883b8e25e8d6 1 parent 3724939
@markh794 authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 usr/ssc.c
View
5 usr/ssc.c
@@ -835,7 +835,7 @@ uint8_t ssc_mode_select(struct scsi_cmd *cmd)
/* Ignore mode pages if 'save pages' bit not set */
if (!save_pages) {
- MHVTL_DBG(1, "Save pages bit not set. Ignoring page data");
+ MHVTL_DBG(1, " Save pages bit not set. Ignoring page data");
return SAM_STAT_GOOD;
}
@@ -908,6 +908,9 @@ uint8_t ssc_mode_select(struct scsi_cmd *cmd)
if (page_len == 0) { /* Something wrong with data structure */
page_len = cmd->dbuf_p->sz;
MHVTL_LOG("Problem with mode select data structure");
+ mkSenseBuf(ILLEGAL_REQUEST, E_INVALID_FIELD_IN_CDB,
+ sam_stat);
+ return SAM_STAT_CHECK_CONDITION;
}
i += page_len; /* Next mode page */
}
Please sign in to comment.
Something went wrong with that request. Please try again.