Skip to content

Commit 2dddbf8

Browse files
Quinn Trangregkh
authored andcommitted
scsi: qla2xxx: Fix buffer overrun
commit b68710a upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 477bc74 commit 2dddbf8

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
@@ -5571,7 +5571,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha)
55715571
__be32 *q;
55725572

55735573
memset(ha->init_cb, 0, ha->init_cb_size);
5574-
sz = min_t(int, sizeof(struct fc_els_flogi), ha->init_cb_size);
5574+
sz = min_t(int, sizeof(struct fc_els_csp), ha->init_cb_size);
55755575
rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma,
55765576
ha->init_cb, sz);
55775577
if (rval != QLA_SUCCESS) {

0 commit comments

Comments
 (0)