All of lore.kernel.org
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@cavium.com>
To: James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com
Cc: himanshu.madhani@cavium.com, linux-scsi@vger.kernel.org
Subject: [PATCH v2 2/7] qla2xxx: Fix NULL pointer access due to redundant fc_host_port_name call
Date: Wed, 24 May 2017 18:06:19 -0700	[thread overview]
Message-ID: <20170525010624.8886-3-himanshu.madhani@cavium.com> (raw)
In-Reply-To: <20170525010624.8886-1-himanshu.madhani@cavium.com>

From: Quinn Tran <quinn.tran@cavium.com>

Remove redundant fc_host_port_name calls to prevent
early access of scsi_host->shost_data buffer. This
prevent null pointer access.

Following stack trace is seen

BUG: unable to handle kernel NULL pointer dereference at 00000000000008
IP: qla24xx_report_id_acquisition+0x22d/0x3a0 [qla2xxx]

Cc: <stable@vger.kernel.org> # 4.11
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
---
 drivers/scsi/qla2xxx/qla_mbx.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index a113ab3592a7..12fea77e31c6 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -3676,15 +3676,6 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,
 				qlt_update_host_map(vha, id);
 			}
 
-			fc_host_port_name(vha->host) =
-			    wwn_to_u64(vha->port_name);
-
-			if (qla_ini_mode_enabled(vha))
-				ql_dbg(ql_dbg_mbx, vha, 0x1018,
-				    "FA-WWN portname %016llx (%x)\n",
-				    fc_host_port_name(vha->host),
-				    rptid_entry->vp_status);
-
 			set_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags);
 			set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags);
 		} else {
-- 
2.12.0

  parent reply	other threads:[~2017-05-25  1:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25  1:06 [PATCH v2 0/7] qla2xxx: Bug Fixes for driver Himanshu Madhani
2017-05-25  1:06 ` [PATCH v2 1/7] qla2xxx: Fix recursive loop during target mode configuration for ISP25XX leaving system unresponsive Himanshu Madhani
2017-05-25  1:06 ` Himanshu Madhani [this message]
2017-05-25  1:06 ` [PATCH v2 3/7] qla2xxx: Fix crash due to mismatch mumber of Q-pair creation for Multi queue Himanshu Madhani
2017-05-25  1:06 ` [PATCH v2 4/7] qla2xxx: Modify T262 FW dump template to specify same start/end to debug customer issues Himanshu Madhani
2017-05-25  1:06 ` [PATCH v2 5/7] qla2xxx: Set bit 15 for DIAG_ECHO_TEST MBC Himanshu Madhani
2017-05-25  1:06 ` [PATCH v2 6/7] qla2xxx: Fix mailbox pointer error in fwdump capture Himanshu Madhani
2017-05-25  1:06 ` [PATCH v2 7/7] qla2xxx: Fix crash due to NULL pointer dereference of ctx Himanshu Madhani
2017-05-25  1:56 ` [PATCH v2 0/7] qla2xxx: Bug Fixes for driver Martin K. Petersen

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=20170525010624.8886-3-himanshu.madhani@cavium.com \
    --to=himanshu.madhani@cavium.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --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.