kernel_optimize_test/fs/sysfs
Vladimir Zapolskiy eaa5cd9263 fs: sysfs: don't pass count == 0 to bin file readers
If count == 0 bytes are requested by a reader, sysfs_kf_bin_read()
deliberately returns 0 without passing a potentially harmful value to
some externally defined underlying battr->read() function.

However in case of (pos == size && count) the next clause always sets
count to 0 and this value is handed over to battr->read().

The change intends to make obsolete (and remove later) a redundant
sanity check in battr->read(), if it is present, or add more
protection to struct bin_attribute users, who does not care about
input arguments.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 10:17:17 +09:00
..
dir.c kernfs: implement kernfs_get_parent(), kernfs_name/path() and friends 2014-02-07 16:05:35 -08:00
file.c fs: sysfs: don't pass count == 0 to bin file readers 2015-06-01 10:17:17 +09:00
group.c sysfs: disambiguate between "error code" and "failure" in comments 2015-05-24 12:31:33 -07:00
Kconfig kernfs: add CONFIG_KERNFS 2014-02-07 16:08:57 -08:00
Makefile
mount.c kernfs: move the last knowledge of sysfs out from kernfs 2014-05-27 14:33:17 -07:00
symlink.c
sysfs.h