]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
added sysfs patch
authorGreg Kroah-Hartman <gregkh@suse.de>
Sat, 1 Apr 2006 01:22:31 +0000 (17:22 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 1 Apr 2006 01:22:31 +0000 (17:22 -0800)
queue-2.6.16/series
queue-2.6.16/sysfs-off-by-one.patch [new file with mode: 0644]

index 803f59201e3e4a5b785d84684a43932e06f54c69..345f9c5dd52ece536018b780a9eb2ef4d0d9adaf 100644 (file)
@@ -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 (file)
index 0000000..3e9949f
--- /dev/null
@@ -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;