Skip to content

Commit 4085aee

Browse files
Quinn TranFishwaldo
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: stable@vger.kernel.org Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Link: https://lore.kernel.org/r/20230607113843.37185-6-njavali@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0efefda commit 4085aee

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
@@ -5359,7 +5359,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha)
53595359
__be32 *q;
53605360

53615361
memset(ha->init_cb, 0, ha->init_cb_size);
5362-
sz = min_t(int, sizeof(struct fc_els_flogi), ha->init_cb_size);
5362+
sz = min_t(int, sizeof(struct fc_els_csp), ha->init_cb_size);
53635363
rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma,
53645364
ha->init_cb, sz);
53655365
if (rval != QLA_SUCCESS) {

0 commit comments

Comments
 (0)