Skip to content

Commit b68710a

Browse files
Quinn Tranmartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix buffer overrun
Klocwork warning: Buffer Overflow - Array Index Out of Bounds Driver uses fc_els_flogi to calculate size of buffer. The actual buffer is nested inside of fc_els_flogi which is smaller. Replace structure name to allow proper size calculation. Cc: [email protected] Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[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 af73f23 commit b68710a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5549,7 +5549,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha)
55495549
__be32 *q;
55505550

55515551
memset(ha->init_cb, 0, ha->init_cb_size);
5552-
sz = min_t(int, sizeof(struct fc_els_flogi), ha->init_cb_size);
5552+
sz = min_t(int, sizeof(struct fc_els_csp), ha->init_cb_size);
55535553
rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma,
55545554
ha->init_cb, sz);
55555555
if (rval != QLA_SUCCESS) {

0 commit comments

Comments
 (0)