projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
597a767
)
[PATCH] sysfs: zero terminate sysfs write buffers
author
Greg Kroah-Hartman
<gregkh@suse.de>
Fri, 31 Mar 2006 23:37:06 +0000
(15:37 -0800)
committer
Linus Torvalds
<torvalds@g5.osdl.org>
Sun, 2 Apr 2006 20:03:31 +0000
(13:03 -0700)
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 supidity here.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/sysfs/file.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/sysfs/file.c
b/fs/sysfs/file.c
index 830f76fa098c531f9db023f74253d9a19a1dff06..f1cb1ddde511d7db0978ebc9bb7c7e3feb453394 100644
(file)
--- a/
fs/sysfs/file.c
+++ b/
fs/sysfs/file.c
@@
-183,7
+183,7
@@
fill_write_buffer(struct sysfs_buffer * buffer, const char __user * buf, size_t
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;