/[linux-patches]/genpatches-2.6/trunk/2.6.14/1493_16.2_sysfs-off-by-one-CVE-2006-1055.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1493_16.2_sysfs-off-by-one-CVE-2006-1055.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 381 - (show annotations) (download) (as text)
Thu Apr 13 15:29:29 2006 UTC (14 years, 7 months ago) by johnm
File MIME type: text/x-diff
File size: 928 byte(s)
Applying appropriate CVE fixes
1 diff-tree 6e0dd741a89be35defa05bd79f4211c5a2762825 (from 597a7679dd83691be2f3a53e1f3f915b4a7f6eba)
2 Author: Greg Kroah-Hartman <gregkh@suse.de>
3 Date: Fri Mar 31 15:37:06 2006 -0800
4
5 [PATCH] sysfs: zero terminate sysfs write buffers
6
7 No one should be writing a PAGE_SIZE worth of data to a normal sysfs
8 file, so properly terminate the buffer.
9
10 Thanks to Al Viro for pointing out my supidity here.
11
12 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 Signed-off-by: Linus Torvalds <torvalds@osdl.org>
14
15 diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
16 index 830f76f..f1cb1dd 100644
17 --- a/fs/sysfs/file.c
18 +++ b/fs/sysfs/file.c
19 @@ -183,7 +183,7 @@ fill_write_buffer(struct sysfs_buffer *
20 return -ENOMEM;
21
22 if (count >= PAGE_SIZE)
23 - count = PAGE_SIZE;
24 + count = PAGE_SIZE - 1;
25 error = copy_from_user(buffer->page,buf,count);
26 buffer->needs_read_fill = 1;
27 return error ? -EFAULT : count;

  ViewVC Help
Powered by ViewVC 1.1.20