]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
scsi: qla2xxx: Avoid that qlt_send_resp_ctio() corrupts memory
authorBart Van Assche <bvanassche@acm.org>
Wed, 17 Apr 2019 21:44:42 +0000 (14:44 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit5c3b3f0e513154bb0bc178d4d9fadca3c618d042
tree5d9b1aeb55a421043b0bac7bb1a5eadbc68ba22c
parent7455f405f8bd29a8f53360c496a3727a747cb16e
scsi: qla2xxx: Avoid that qlt_send_resp_ctio() corrupts memory

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit a861b49273578e255426a499842cf7f465456351 ]

The "(&ctio->u.status1.sense_data)[i]" where i >= 0 expressions in
qlt_send_resp_ctio() are probably typos and should have been
"(&ctio->u.status1.sense_data[4 * i])" instead. Instead of only fixing
these typos, modify the code for storing sense data such that it becomes
easy to read. This patch fixes a Coverity complaint about accessing an
array outside its bounds.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Fixes: be25152c0d9e ("qla2xxx: Improve T10-DIF/PI handling in driver.") # v4.11.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/scsi/qla2xxx/qla_target.c