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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0701021024110.4122-100000@iolanthe.rowland.org>
Date:	Tue, 2 Jan 2007 10:26:32 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Oliver Neukum <oliver@...kum.name>
cc:	gregkh@...e.de, <maneesh@...ibm.com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: error handling in sysfs, fill_read_buffer()

On Tue, 2 Jan 2007, Oliver Neukum wrote:

> Hi,
> 
> if a driver returns an error in fill_read_buffer(), the buffer will be
> marked as filled. Subsequent reads will return eof. But there is
> no data because of an error, not because it has been read.
> Not marking the buffer filled is the obvious fix.
> 
> 	Regards
> 		Oliver
> 
> Signed-off-by: Oliver Neukum <oliver@...kum.name>
> --
> 
> --- a/fs/sysfs/file.c	2006-12-24 05:00:32.000000000 +0100
> +++ b/fs/sysfs/file.c	2007-01-01 15:03:14.000000000 +0100
> @@ -70,7 +70,8 @@
>   *	Allocate @buffer->page, if it hasn't been already, then call the
>   *	kobject's show() method to fill the buffer with this attribute's 
>   *	data. 
> - *	This is called only once, on the file's first read. 
> + *	This is called only once, on the file's first read unless an error
> + *	is returned.
>   */

I don't think this matches what people expect of sysfs.  If a show method 
fails then the assumption is that the file cannot be read at all, so 
there's no point in trying to call the method again.

Alan Stern

-
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