mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 04:20:23 +09:00
scsi: qla2xxx: Fix buffer overrun
commit b68710a809 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4406fe8a96
commit
89250e775d
@@ -5359,7 +5359,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha)
|
||||
__be32 *q;
|
||||
|
||||
memset(ha->init_cb, 0, ha->init_cb_size);
|
||||
sz = min_t(int, sizeof(struct fc_els_flogi), ha->init_cb_size);
|
||||
sz = min_t(int, sizeof(struct fc_els_csp), ha->init_cb_size);
|
||||
rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma,
|
||||
ha->init_cb, sz);
|
||||
if (rval != QLA_SUCCESS) {
|
||||
|
||||
Reference in New Issue
Block a user