From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Qian Cai <cai@lca.pw>
Cc: akpm@linux-foundation.org, kashyap.desai@broadcom.com,
sumit.saxena@broadcom.com,
shivasharan.srikanteshwara@broadcom.com, jejb@linux.vnet.ibm.com,
martin.petersen@oracle.com, thenzl@redhat.com, hch@lst.de,
megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH v2] megaraid: fix out-of-bound array accesses
Date: Tue, 18 Dec 2018 23:24:50 -0500 [thread overview]
Message-ID: <yq1y38mgn3h.fsf@oracle.com> (raw)
In-Reply-To: <20181213132727.57058-1-cai@lca.pw> (Qian Cai's message of "Thu, 13 Dec 2018 08:27:27 -0500")
> diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c
> index 59ecbb3b53b5..a33628550425 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_fp.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
> @@ -1266,7 +1266,7 @@ void mr_update_load_balance_params(struct MR_DRV_RAID_MAP_ALL *drv_map,
>
> for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) {
> ld = MR_TargetIdToLdGet(ldCount, drv_map);
> - if (ld >= MAX_LOGICAL_DRIVES_EXT) {
> + if (ld >= MAX_LOGICAL_DRIVES_EXT - 1) {
> lbInfo[ldCount].loadBalanceFlag = 0;
> continue;
> }
> diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> index f74b5ea24f0f..49eaa87608f6 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> @@ -2832,7 +2832,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance,
> device_id < instance->fw_supported_vd_count)) {
>
> ld = MR_TargetIdToLdGet(device_id, local_map_ptr);
> - if (ld >= instance->fw_supported_vd_count)
> + if (ld >= instance->fw_supported_vd_count - 1)
> fp_possible = 0;
> else {
> raid = MR_LdRaidGet(ld, local_map_ptr);
Kashyap, Sumit, Shivasharan: Please review!
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2018-12-19 4:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <d2fe9d6a-3716-98d2-e311-74188b259038@gmx.us>
2018-12-06 15:53 ` [PATCH] megaraid: fix a out-of-bound array access Qian Cai
2018-12-06 21:22 ` [PATCH v2] megaraid: fix out-of-bound array accesses Qian Cai
2018-12-13 13:27 ` [RESEND PATCH " Qian Cai
2018-12-19 4:24 ` Martin K. Petersen [this message]
2018-12-20 7:55 ` Sumit Saxena
2018-12-21 0:50 ` 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=yq1y38mgn3h.fsf@oracle.com \
--to=martin.petersen@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=cai@lca.pw \
--cc=hch@lst.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=megaraidlinux.pdl@broadcom.com \
--cc=shivasharan.srikanteshwara@broadcom.com \
--cc=sumit.saxena@broadcom.com \
--cc=thenzl@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox