public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "keescook@chromium.org" <keescook@chromium.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"QLogic-Storage-Upstream@cavium.com"
	<QLogic-Storage-Upstream@cavium.com>,
	"danielmicay@gmail.com" <danielmicay@gmail.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: [PATCH] scsi: qedf: Avoid reading past end of buffer
Date: Fri, 5 May 2017 23:01:04 +0000	[thread overview]
Message-ID: <1494025263.2744.22.camel@sandisk.com> (raw)
In-Reply-To: <20170505224255.GA21521@beast>

On Fri, 2017-05-05 at 15:42 -0700, Kees Cook wrote:
> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
> index cceddd995a4b..a5c97342fd5d 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -2895,7 +2895,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
>  	slowpath_params.drv_minor = QEDF_DRIVER_MINOR_VER;
>  	slowpath_params.drv_rev = QEDF_DRIVER_REV_VER;
>  	slowpath_params.drv_eng = QEDF_DRIVER_ENG_VER;
> -	memcpy(slowpath_params.name, "qedf", QED_DRV_VER_STR_SIZE);
> +	strncpy(slowpath_params.name, "qedf", QED_DRV_VER_STR_SIZE);
>  	rc = qed_ops->common->slowpath_start(qedf->cdev, &slowpath_params);
>  	if (rc) {
>  		QEDF_ERR(&(qedf->dbg_ctx), "Cannot start slowpath.\n");

Hello Kees,

Although this patch looks fine to me, isn't strlcpy() preferred over strncpy()?

Bart.

  reply	other threads:[~2017-05-05 23:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 22:42 [PATCH] scsi: qedf: Avoid reading past end of buffer Kees Cook
2017-05-05 23:01 ` Bart Van Assche [this message]
2017-05-05 23:10   ` Kees Cook
2017-05-06 19:00     ` Chad Dupuis
2017-05-09  2:08 ` 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=1494025263.2744.22.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=QLogic-Storage-Upstream@cavium.com \
    --cc=danielmicay@gmail.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox