Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1636783
| From | Bart Van Assche <Bart.VanAssche@sandisk.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] scsi: qedf: Avoid reading past end of buffer |
| Date | 2017-05-06 01:10 +0200 |
| Message-ID | <tDUwh-8nd-5@gated-at.bofh.it> (permalink) |
| References | <tDUcV-80b-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] scsi: qedf: Avoid reading past end of buffer Kees Cook <keescook@chromium.org> - 2017-05-06 00:50 +0200
Re: [PATCH] scsi: qedf: Avoid reading past end of buffer Bart Van Assche <Bart.VanAssche@sandisk.com> - 2017-05-06 01:10 +0200
Re: [PATCH] scsi: qedf: Avoid reading past end of buffer Kees Cook <keescook@chromium.org> - 2017-05-06 01:20 +0200
Re: [PATCH] scsi: qedf: Avoid reading past end of buffer "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-05-09 04:10 +0200
csiph-web