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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 2 Jun 2008 09:35:52 +0400
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	akinobu.mita@...il.com
Cc:	linux-kernel@...r.kernel.org,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [patch -v2 01/23] sunrpc: use simple_read_from_buffer

On Mon, Jun 02, 2008 at 08:13:30AM +0900, akinobu.mita@...il.com wrote:
> Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: netdev@...r.kernel.org
> ---
>  net/sunrpc/cache.c |   15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> Index: 2.6-git/net/sunrpc/cache.c
> ===================================================================
> --- 2.6-git.orig/net/sunrpc/cache.c
> +++ 2.6-git/net/sunrpc/cache.c
> @@ -1271,20 +1271,11 @@ static ssize_t read_flush(struct file *f
>  {
>  	struct cache_detail *cd = PDE(file->f_path.dentry->d_inode)->data;
>  	char tbuf[20];
> -	unsigned long p = *ppos;
>  	size_t len;
>  
> -	sprintf(tbuf, "%lu\n", cd->flush_time);
> -	len = strlen(tbuf);
> -	if (p >= len)
> -		return 0;
> -	len -= p;
> -	if (len > count)
> -		len = count;
> -	if (copy_to_user(buf, (void*)(tbuf+p), len))
> -		return -EFAULT;
> -	*ppos += len;
> -	return len;
> +	len = sprintf(tbuf, "%lu\n", cd->flush_time);
> +
> +	return simple_read_from_buffer(buf, count, ppos, tbuf, len);
>  }

Please, switch to seq_file:

	seq_printf(m, "%lu\n", cd->flush_time);
	return 0;

and that's everything module have to worry about.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists