]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: mpi3mr: Fix missing mrioc->evtack_cmds initialization
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 14 Feb 2023 00:50:19 +0000 (09:50 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:06 +0000 (09:34 +0100)
commita1c001af4fb9f21c2f6a21595221b862b4d64403
treeda383abcfa99db2164adabd17fee86474cdfcbc6
parent90f67d6826f215101b0041b046b489d06ddb7516
scsi: mpi3mr: Fix missing mrioc->evtack_cmds initialization

commit 94fc34b9c6c2a810fdaf346fd575549522c27099 upstream.

Commit 27520aec84f7 ("scsi: mpi3mr: Add Event acknowledgment logic")
introduced an array mrioc->evtack_cmds but initialization of the array
elements was missed. They are just zero cleared. The function
mpi3mr_complete_evt_ack() refers host_tag field of the elements. Due to the
zero value of the host_tag field, the function calls clear_bit() for
mrico->evtack_cmds_bitmap with wrong bit index. This results in memory
access to invalid address and "BUG: KASAN: use-after-free". This BUG was
observed at eHBA-9600 firmware update to version 8.3.1.0. To fix it, add
the missing initialization of mrioc->evtack_cmds.

Link: https://lore.kernel.org/r/20230214005019.1897251-5-shinichiro.kawasaki@wdc.com
Cc: stable@vger.kernel.org
Fixes: 27520aec84f7 ("scsi: mpi3mr: Add Event acknowledgment logic")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/mpi3mr/mpi3mr_os.c