Skip to content

Commit 4406e41

Browse files
Dan Carpentermartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix off by one in qla_edif_app_getstats()
The app_reply->elem[] array is allocated earlier in this function and it has app_req.num_ports elements. Thus this > comparison needs to be >= to prevent memory corruption. Fixes: 7878f22 ("scsi: qla2xxx: edif: Add getfcinfo and statistic bsgs") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 0098c55 commit 4406e41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/qla2xxx/qla_edif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ qla_edif_app_getstats(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
11001100

11011101
list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
11021102
if (fcport->edif.enable) {
1103-
if (pcnt > app_req.num_ports)
1103+
if (pcnt >= app_req.num_ports)
11041104
break;
11051105

11061106
app_reply->elem[pcnt].rekey_count =

0 commit comments

Comments
 (0)