public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <jsmart2021@gmail.com>,
	Dick Kennedy <dick.kennedy@broadcom.com>,
	James Smart <james.smart@broadcom.com>
Subject: [PATCH v2 12/17] lpfc: Null pointer dereference when log_verbose is set to 0xffffffff
Date: Thu,  1 Jun 2017 21:07:06 -0700	[thread overview]
Message-ID: <20170602040711.21046-13-jsmart2021@gmail.com> (raw)
In-Reply-To: <20170602040711.21046-1-jsmart2021@gmail.com>

Kernel panic when log_verbose is set to 0xffffffff

phba->pport is dereferenced before it is initialized

Fix: Do not dereference phba->pport if it is NULL

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index c4ceef69bd6b..fb4c708ae747 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -7513,7 +7513,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
 				"(%d):0308 Mbox cmd issue - BUSY Data: "
 				"x%x x%x x%x x%x\n",
 				pmbox->vport ? pmbox->vport->vpi : 0xffffff,
-				mbx->mbxCommand, phba->pport->port_state,
+				mbx->mbxCommand,
+				phba->pport ? phba->pport->port_state : 0xff,
 				psli->sli_flag, flag);
 
 		psli->slistat.mbox_busy++;
@@ -7565,7 +7566,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
 			"(%d):0309 Mailbox cmd x%x issue Data: x%x x%x "
 			"x%x\n",
 			pmbox->vport ? pmbox->vport->vpi : 0,
-			mbx->mbxCommand, phba->pport->port_state,
+			mbx->mbxCommand,
+			phba->pport ? phba->pport->port_state : 0xff,
 			psli->sli_flag, flag);
 
 	if (mbx->mbxCommand != MBX_HEARTBEAT) {
-- 
2.11.0

  parent reply	other threads:[~2017-06-02  4:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02  4:06 [PATCH v2 00/17] lpfc updates for 11.4.0.0 James Smart
2017-06-02  4:06 ` [PATCH v2 01/17] lpfc: Add nvme initiator devloss support James Smart
2017-06-02  4:06 ` [PATCH v2 02/17] lpfc: Fix transition nvme-i rport handling to nport only James Smart
2017-06-02  4:06 ` [PATCH v2 03/17] lpfc: Fix nvme port role handling in sysfs and debugfs handlers James Smart
2017-06-02  4:06 ` [PATCH v2 04/17] lpfc: Add changes to assist in NVMET debugging James Smart
2017-06-02  4:06 ` [PATCH v2 05/17] lpfc: Fix Lun Priority level shown as NA James Smart
2017-06-02  4:07 ` [PATCH v2 06/17] lpfc: Fix nvmet node ref count handling James Smart
2017-06-02  4:07 ` [PATCH v2 07/17] lpfc: Fix Port going offline after multiple resets James Smart
2017-06-02  4:07 ` [PATCH v2 08/17] lpfc: Fix counters so outstandng NVME IO count is accurate James Smart
2017-06-02  4:07 ` [PATCH v2 09/17] lpfc: Fix return value of board_mode store routine in case of online failure James Smart
2017-06-02  4:07 ` [PATCH v2 10/17] lpfc: Fix crash on powering off BFS VM with passthrough device James Smart
2017-06-02  4:07 ` [PATCH v2 11/17] lpfc: Fix System panic after loading the driver James Smart
2017-06-02  4:07 ` James Smart [this message]
2017-06-02  4:07 ` [PATCH v2 13/17] lpfc: Fix PRLI retry handling when target rejects it James Smart
2017-06-02  4:07 ` [PATCH v2 14/17] lpfc: Fix vports not logging into target James Smart
2017-06-02  4:07 ` [PATCH v2 15/17] lpfc: Fix defects reported by Coverity Scan James Smart
2017-06-02  4:07 ` [PATCH v2 16/17] lpfc: Add auto EQ delay logic James Smart
2017-06-02  4:07 ` [PATCH v2 17/17] lpfc: update to revision to 11.4.0.0 James Smart
2017-06-06  1:13 ` [PATCH v2 00/17] lpfc updates for 11.4.0.0 Martin K. Petersen
2017-06-07  4:20   ` James Smart
2017-06-13  3:04     ` Martin K. Petersen
2017-06-15 16:59       ` James Smart

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=20170602040711.21046-13-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=dick.kennedy@broadcom.com \
    --cc=james.smart@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox