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, 23 May 2016 14:02:32 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	falakreyaz@...il.com
Cc:	kas@...muni.cz, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] wan: cosa: use memdup_user().

From: Muhammad Falak R Wani <falakreyaz@...il.com>
Date: Fri, 20 May 2016 17:50:06 +0530

> Use memdup_user to duplicate a memory region from user-space to
> kernel-space, instead of open coding using kmalloc & copy_from_user.
> 
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@...il.com>
> ---
>  drivers/net/wan/cosa.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
> index b87fe0a..fb37439 100644
> --- a/drivers/net/wan/cosa.c
> +++ b/drivers/net/wan/cosa.c
> @@ -876,15 +876,10 @@ static ssize_t cosa_write(struct file *file,
>  		count = COSA_MTU;
>  	
>  	/* Allocate the buffer */
> -	kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA);
> -	if (kbuf == NULL) {
> +	kbuf = memdup_user(buf, count);

You're losing the GFP_DMA specification here, therefore this change
is not correct.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ