Re: [PATCH] lpfc: fix missing zero termination in debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
> ---
>  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@xxxxxxx>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@xxxxxxx                                +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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux