[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230403143440.1923323-1-Igor.A.Artemiev@mcst.ru>
Date: Mon, 3 Apr 2023 17:34:40 +0300
From: Igor Artemiev <Igor.A.Artemiev@...t.ru>
To: Kashyap Desai <kashyap.desai@...adcom.com>
Cc: Igor Artemiev <Igor.A.Artemiev@...t.ru>,
Sumit Saxena <sumit.saxena@...adcom.com>,
Shivasharan S <shivasharan.srikanteshwara@...adcom.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
megaraidlinux.pdl@...adcom.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: [PATCH] scsi: megaraid: Fix null dereference
When cmdid == CMDID_INT_CMDS, the 'mbox' 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: Igor Artemiev <Igor.A.Artemiev@...t.ru>
---
drivers/scsi/megaraid.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index bf491af9f0d6..4fbf92dc717e 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;
+ mbox = (mbox_t *)scb->raw_mbox;
list_del_init(&scb->list);
scb->state = SCB_FREE;
--
2.30.2
Powered by blists - more mailing lists