diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-31 16:03:30 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-31 16:03:30 -0800 |
commit | f58ad68f00c1744fddbf67fd7467912ae6b42eae (patch) | |
tree | cc75e8bc4f4d3aae62eece59adb3cc8f376e5e36 /driver | |
parent | 80d534567378ce62ba8e2c51a3b6621e5b8b5605 (diff) | |
download | patches-f58ad68f00c1744fddbf67fd7467912ae6b42eae.tar.gz |
sysfs patch
Diffstat (limited to 'driver')
-rw-r--r-- | driver/sysfs-off-by-one.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/driver/sysfs-off-by-one.patch b/driver/sysfs-off-by-one.patch new file mode 100644 index 0000000000000..3e9949f4b851c --- /dev/null +++ b/driver/sysfs-off-by-one.patch @@ -0,0 +1,27 @@ +From foo@baz Tue Apr 9 12:12:43 2002 +Date: Fri, 31 Mar 2006 15:37:06 -0800 +From: Greg Kroah-Hartman <gregkh@suse.de> +Subject: sysfs: zero terminate sysfs write buffers + +No one should be writing a PAGE_SIZE worth of data to a normal sysfs +file, so properly terminate the buffer. + +Thanks to Al Viro for pointing out my stupidity here. + +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + fs/sysfs/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- gregkh-2.6.orig/fs/sysfs/file.c ++++ gregkh-2.6/fs/sysfs/file.c +@@ -192,7 +192,7 @@ fill_write_buffer(struct sysfs_buffer * + return -ENOMEM; + + if (count >= PAGE_SIZE) +- count = PAGE_SIZE; ++ count = PAGE_SIZE - 1; + error = copy_from_user(buffer->page,buf,count); + buffer->needs_read_fill = 1; + return error ? -EFAULT : count; |