mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@oracle.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Quinn Tran <qutran@marvell.com>,
	Nilesh Javali <njavali@marvell.com>,
	"GR-QLogic-Storage-Upstream@marvell.com"
	<GR-QLogic-Storage-Upstream@marvell.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Martin Petersen <martin.petersen@oracle.com>,
	Larry Wisneski <Larry.Wisneski@marvell.com>,
	Duane Grigsby <duane.grigsby@marvell.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] scsi: qla2xxx: Fix off by one in qla_edif_app_getstats()
Date: Tue, 2 Apr 2024 15:42:15 +0000	[thread overview]
Message-ID: <ABEE85CC-86A8-4DBB-A409-212834875E08@oracle.com> (raw)
In-Reply-To: <5c125b2f-92dd-412b-9b6f-fc3a3207bd60@moroto.mountain>



> On Apr 2, 2024, at 02:56, Dan Carpenter <dan.carpenter@linaro.org> wrote:
> 
> The app_reply->elem[] array is allocated earlier in this function and it
> has app_req.num_ports elements.  Thus this > comparison needs to be >=
> to prevent memory corruption.
> 
> Fixes: 7878f22a2e03 ("scsi: qla2xxx: edif: Add getfcinfo and statistic bsgs")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/scsi/qla2xxx/qla_edif.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
> index 26e6b3e3af43..dcde55c8ee5d 100644
> --- a/drivers/scsi/qla2xxx/qla_edif.c
> +++ b/drivers/scsi/qla2xxx/qla_edif.c
> @@ -1100,7 +1100,7 @@ qla_edif_app_getstats(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
> 
> list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
> if (fcport->edif.enable) {
> - if (pcnt > app_req.num_ports)
> + if (pcnt >= app_req.num_ports)
> break;
> 
> app_reply->elem[pcnt].rekey_count =
> -- 
> 2.43.0
> 

Looks Good.

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com <mailto:himanshu.madhani@oracle.com>>

-- 
Himanshu Madhani Oracle Linux Engineering


  reply	other threads:[~2024-04-02 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02  9:56 Dan Carpenter
2024-04-02 15:42 ` Himanshu Madhani [this message]
2024-04-02 15:51 ` Himanshu Madhani
2024-04-06  1:58 ` 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=ABEE85CC-86A8-4DBB-A409-212834875E08@oracle.com \
    --to=himanshu.madhani@oracle.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=Larry.Wisneski@marvell.com \
    --cc=dan.carpenter@linaro.org \
    --cc=duane.grigsby@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=njavali@marvell.com \
    --cc=qutran@marvell.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

all inboxes | Powered by JetHome®