lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 02 Jun 2014 10:56:51 -0700
From:	Joe Perches <joe@...ches.com>
To:	Fabian Frederick <fabf@...net.be>
Cc:	linux-kernel@...r.kernel.org,
	Anil Gurumurthy <anil.gurumurthy@...gic.com>,
	"James E.J. Bottomley" <JBottomley@...allels.com>,
	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
Subject: Re: [PATCH V3] drivers/scsi/bfa/bfad_debugfs.c: replace 2
 kzalloc/copy_from_user by memdup_user

On Mon, 2014-06-02 at 19:50 +0200, Fabian Frederick wrote:
> This patch also removes unnecessary printk(KERN_INFO
[]
> diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c
[]
> @@ -260,18 +260,10 @@ bfad_debugfs_write_regrd(struct file *file, const char __user *buf,
>  	unsigned long flags;
>  	void *kern_buf;
>  
> -	kern_buf = kzalloc(nbytes, GFP_KERNEL);
> +	kern_buf = memdup_user(buf, nbytes);
>  

trivial note:

There's an uncommon blank line here.

Generally this form is:

	foo = memdup_user(bar, len);
	if (IS_ERR(foo))

not

	foo = memdup_user(bar, len);

	if (IS_ERR(foo))


> @@ -336,18 +328,10 @@ bfad_debugfs_write_regwr(struct file *file, const char __user *buf,
>  	unsigned long flags;
>  	void *kern_buf;
>  
> -	kern_buf = kzalloc(nbytes, GFP_KERNEL);
> +	kern_buf = memdup_user(buf, nbytes);
>  

here too.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ