* [PATCH] lpfc: fix missing zero termination in debugfs
@ 2016-02-15 19:11 Alan
2016-02-16 6:52 ` Johannes Thumshirn
2016-02-18 0:17 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Alan @ 2016-02-15 19:11 UTC (permalink / raw)
To: linux-scsi, jthumshirn
If you feed 32 bytes in then the kstrtoull() doesn't receive a terminated
string so will run off the end.
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/scsi/lpfc/lpfc_debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index 25aa9b9..a63542b 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -1054,11 +1054,11 @@ lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf,
{
struct dentry *dent = file->f_path.dentry;
struct lpfc_hba *phba = file->private_data;
- char dstbuf[32];
+ char dstbuf[33];
uint64_t tmp = 0;
int size;
- memset(dstbuf, 0, 32);
+ memset(dstbuf, 0, 33);
size = (nbytes < 32) ? nbytes : 32;
if (copy_from_user(dstbuf, buf, size))
return 0;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] lpfc: fix missing zero termination in debugfs
2016-02-15 19:11 [PATCH] lpfc: fix missing zero termination in debugfs Alan
@ 2016-02-16 6:52 ` Johannes Thumshirn
2016-02-18 0:17 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2016-02-16 6:52 UTC (permalink / raw)
To: Alan; +Cc: linux-scsi
On Mon, Feb 15, 2016 at 07:11:56PM +0000, Alan wrote:
> If you feed 32 bytes in then the kstrtoull() doesn't receive a terminated
> string so will run off the end.
>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
> drivers/scsi/lpfc/lpfc_debugfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
> index 25aa9b9..a63542b 100644
> --- a/drivers/scsi/lpfc/lpfc_debugfs.c
> +++ b/drivers/scsi/lpfc/lpfc_debugfs.c
> @@ -1054,11 +1054,11 @@ lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf,
> {
> struct dentry *dent = file->f_path.dentry;
> struct lpfc_hba *phba = file->private_data;
> - char dstbuf[32];
> + char dstbuf[33];
> uint64_t tmp = 0;
> int size;
>
> - memset(dstbuf, 0, 32);
> + memset(dstbuf, 0, 33);
> size = (nbytes < 32) ? nbytes : 32;
> if (copy_from_user(dstbuf, buf, size))
> return 0;
>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] lpfc: fix missing zero termination in debugfs
2016-02-15 19:11 [PATCH] lpfc: fix missing zero termination in debugfs Alan
2016-02-16 6:52 ` Johannes Thumshirn
@ 2016-02-18 0:17 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2016-02-18 0:17 UTC (permalink / raw)
To: Alan; +Cc: linux-scsi, jthumshirn
>>>>> "Alan" == Alan <gnomes@lxorguk.ukuu.org.uk> writes:
Alan> If you feed 32 bytes in then the kstrtoull() doesn't receive a
Alan> terminated string so will run off the end.
Applied to 4.6/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-18 0:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15 19:11 [PATCH] lpfc: fix missing zero termination in debugfs Alan
2016-02-16 6:52 ` Johannes Thumshirn
2016-02-18 0:17 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox