From: Greg Kroah-Hartman Date: Sat, 1 Apr 2006 01:22:31 +0000 (-0800) Subject: added sysfs patch X-Git-Tag: v2.6.16.2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92e4cb1860a42e372850349cf5e59a563ee0fe4e;p=thirdparty%2Fkernel%2Fstable-queue.git added sysfs patch --- diff --git a/queue-2.6.16/series b/queue-2.6.16/series index 803f59201e3..345f9c5dd52 100644 --- a/queue-2.6.16/series +++ b/queue-2.6.16/series @@ -1,2 +1,3 @@ tlclk-fix-handling-of-device-major.patch usb-0079-Fix-irda-usb-use-after-use.patch +sysfs-off-by-one.patch diff --git a/queue-2.6.16/sysfs-off-by-one.patch b/queue-2.6.16/sysfs-off-by-one.patch new file mode 100644 index 00000000000..3e9949f4b85 --- /dev/null +++ b/queue-2.6.16/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 +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 + +--- + 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;