Message ID | 20230317175109.18585-1-listdansp@mail.ru |
---|---|
State | New |
Headers | show |
Series | megaraid: fix mega_cmd_done CMDID_INT_CMDS | expand |
On Fri, 17 Mar 2023 17:51:09 +0000, Danila Chernetsov wrote: > When cmdid == CMDID_INT_CMDS, the 'cmds' pointer is NULL but is dereferenced below. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Applied to 6.4/scsi-queue, thanks! [1/1] megaraid: fix mega_cmd_done CMDID_INT_CMDS https://git.kernel.org/mkp/scsi/c/75cb113cd43f
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index bf491af9f0d6..16e2cf848c6e 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1441,6 +1441,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) */ if (cmdid == CMDID_INT_CMDS) { scb = &adapter->int_scb; + cmd = scb->cmd; list_del_init(&scb->list); scb->state = SCB_FREE;
When cmdid == CMDID_INT_CMDS, the 'cmds' pointer is NULL but is dereferenced below. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 0f2bb84d2a68 ("[SCSI] megaraid: simplify internal command handling") Signed-off-by: Danila Chernetsov <listdansp@mail.ru> --- drivers/scsi/megaraid.c | 1 + 1 file changed, 1 insertion(+)