linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chad Dupuis <chad.dupuis@qlogic.com>
To: jbottomley@parallels.com
Cc: giridhar.malavali@qlogic.com, chad.dupuis@qlogic.com,
	andrew.vasquez@qlogic.com, linux-scsi@vger.kernel.org
Subject: [PATCH 06/11] qla2xxx: Correct out of bounds read of ISP2200 mailbox registers.
Date: Thu, 9 Feb 2012 11:14:08 -0800	[thread overview]
Message-ID: <1328814853-21764-7-git-send-email-chad.dupuis@qlogic.com> (raw)
In-Reply-To: <1328814853-21764-1-git-send-email-chad.dupuis@qlogic.com>

From: Andrew Vasquez <andrew.vasquez@qlogic.com>

ISP2200 adapters only have 24 mailbox registers so read only that many.

Reported-by: Olatunji Ruwase <oor@cs.cmu.edu>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_def.h |    1 +
 drivers/scsi/qla2xxx/qla_os.c  |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index a6a4eeb..af1003f 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -44,6 +44,7 @@
  * ISP2100 HBAs.
  */
 #define MAILBOX_REGISTER_COUNT_2100	8
+#define MAILBOX_REGISTER_COUNT_2200	24
 #define MAILBOX_REGISTER_COUNT		32
 
 #define QLA2200A_RISC_ROM_VER	4
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 5fd89d7..7e617a6 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2054,7 +2054,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 		ha->nvram_data_off = ~0;
 		ha->isp_ops = &qla2100_isp_ops;
 	} else if (IS_QLA2200(ha)) {
-		ha->mbx_count = MAILBOX_REGISTER_COUNT;
+		ha->mbx_count = MAILBOX_REGISTER_COUNT_2200;
 		req_length = REQUEST_ENTRY_CNT_2200;
 		rsp_length = RESPONSE_ENTRY_CNT_2100;
 		ha->max_loop_id = SNS_LAST_LOOP_ID_2100;
-- 
1.6.0.2



  parent reply	other threads:[~2012-02-09 19:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 19:14 [PATCH 00/11] qla2xxx: Patches for 3.3-rc Chad Dupuis
2012-02-09 19:14 ` [PATCH 01/11] qla2xxx: Propagate up abort failures Chad Dupuis
2012-02-09 19:14 ` [PATCH 02/11] qla2xxx: Add check for null fcport references in qla2xxx_queuecommand Chad Dupuis
2012-02-09 19:14 ` [PATCH 03/11] qla2xxx: Add an "is reset active" helper Chad Dupuis
2012-02-09 19:14 ` [PATCH 04/11] qla2xxx: Clear options-flags while issuing stop-firmware mbx command Chad Dupuis
2012-02-09 19:14 ` [PATCH 05/11] qla2xxx: Remove errant clearing of MBX_INTERRUPT flag during CT-IOCB processing Chad Dupuis
2012-02-09 19:14 ` Chad Dupuis [this message]
2012-02-09 19:14 ` [PATCH 07/11] qla2xxx: Remove check for null fcport from host reset handler Chad Dupuis
2012-02-09 19:14 ` [PATCH 08/11] qla2xxx: Complete mailbox command timedout to avoid initialization failures during next reset cycle Chad Dupuis
2012-02-09 19:14 ` [PATCH 09/11] qla2xxx: Remove resetting memory during device initialization for ISP82xx Chad Dupuis
2012-02-09 19:14 ` [PATCH 10/11] qla2xxx: Proper detection of firmware abort error code " Chad Dupuis
2012-02-09 19:14 ` [PATCH 11/11] qla2xxx: Update version number to 8.03.07.13-k Chad Dupuis

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=1328814853-21764-7-git-send-email-chad.dupuis@qlogic.com \
    --to=chad.dupuis@qlogic.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=jbottomley@parallels.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;
as well as URLs for NNTP newsgroup(s).