From: "Ewan D. Milne" <emilne@redhat.com>
To: Maurizio Lombardi <mlombard@redhat.com>
Cc: james.smart@broadcom.com, dick.kennedy@broadcom.com,
linux-scsi@vger.kernel.org, jejb@linux.vnet.ibm.com,
martin.petersen@oracle.com
Subject: Re: [PATCH] scsi: lpfc: fix potential buffer overflow.
Date: Tue, 18 Apr 2017 11:07:13 -0400 [thread overview]
Message-ID: <1492528033.27344.167.camel@localhost.localdomain> (raw)
In-Reply-To: <1492509351-25441-1-git-send-email-mlombard@redhat.com>
On Tue, 2017-04-18 at 11:55 +0200, Maurizio Lombardi wrote:
> This patch fixes a potential buffer overflow in lpfc_nvme_info_show().
>
> Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
> ---
> drivers/scsi/lpfc/lpfc_attr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
> index 22819af..1ce252f 100644
> --- a/drivers/scsi/lpfc/lpfc_attr.c
> +++ b/drivers/scsi/lpfc/lpfc_attr.c
> @@ -181,7 +181,7 @@
> wwn_to_u64(vport->fc_nodename.u.wwn),
> phba->targetport->port_id);
>
> - len += snprintf(buf + len, PAGE_SIZE,
> + len += snprintf(buf + len, PAGE_SIZE - len,
> "\nNVME Target: Statistics\n");
> tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private;
> len += snprintf(buf+len, PAGE_SIZE-len,
> @@ -326,7 +326,7 @@
> }
> spin_unlock_irq(shost->host_lock);
>
> - len += snprintf(buf + len, PAGE_SIZE, "\nNVME Statistics\n");
> + len += snprintf(buf + len, PAGE_SIZE - len, "\nNVME Statistics\n");
> len += snprintf(buf+len, PAGE_SIZE-len,
> "LS: Xmt %016llx Cmpl %016llx\n",
> phba->fc4NvmeLsRequests,
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
next prev parent reply other threads:[~2017-04-18 15:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 9:55 [PATCH] scsi: lpfc: fix potential buffer overflow Maurizio Lombardi
2017-04-18 15:07 ` Ewan D. Milne [this message]
2017-04-18 21:15 ` James Smart
2017-04-19 2:01 ` 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=1492528033.27344.167.camel@localhost.localdomain \
--to=emilne@redhat.com \
--cc=dick.kennedy@broadcom.com \
--cc=james.smart@broadcom.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mlombard@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 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.