From: Tong Zhang <ztong0001@gmail.com>
To: Hannes Reinecke <hare@kernel.org>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: ztong0001@gmail.com
Subject: [PATCH 2/2] scsi: myrb: fix null-ptr-dereference in myrb_probe
Date: Sun, 21 Mar 2021 20:29:35 -0400 [thread overview]
Message-ID: <20210322002936.1352871-3-ztong0001@gmail.com> (raw)
In-Reply-To: <20210322002936.1352871-1-ztong0001@gmail.com>
cb->host should be initialized and set before it is used by the
following probe logic and the interrupt handler etc.
[ 5.073493] BUG: kernel NULL pointer dereference, address: 00000000000002cc
[ 5.075907] RIP: 0010:kobject_put+0x25/0x120
[ 5.081572] Call Trace:
[ 5.081720] myrb_probe.cold+0x22/0xabc [myrb]
[ 5.083510] local_pci_probe+0x6f/0xb0
Fixes: 081ff398c56c ("scsi: myrb: Add Mylex RAID controller (block interface)")
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
---
drivers/scsi/myrb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index ee33d97fb92c..7de49b869128 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -3512,6 +3512,7 @@ static struct myrb_hba *myrb_detect(struct pci_dev *pdev,
shost->max_cmd_len = 12;
shost->max_lun = 256;
cb = shost_priv(shost);
+ cb->host = shost;
mutex_init(&cb->dcmd_mutex);
mutex_init(&cb->dma_mutex);
cb->pdev = pdev;
--
2.25.1
prev parent reply other threads:[~2021-03-22 0:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 0:29 [PATCH 0/2] scsi: myrb: fix null-ptr-dereference issues Tong Zhang
2021-03-22 0:29 ` [PATCH 1/2] scsi: myrb: fix null-ptr-dereference in myrb_cleanup Tong Zhang
2021-03-22 0:29 ` Tong Zhang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210322002936.1352871-3-ztong0001@gmail.com \
--to=ztong0001@gmail.com \
--cc=hare@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.