summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2003-04-16 00:11:22 -0700
committerPatrick Mochel <mochel@osdl.org>2003-04-16 00:11:22 -0700
commit185b8e246f4651850cad12aaa5d2c50946b7dcdb (patch)
tree44fda158c108669001c91fb0d9d6257d78cef650 /include/linux
parent65f99db20c17c56f5e74df04daf7dce874742934 (diff)
sysfs: Rewrite binary file handling.
From Matthew Wilcox. - Remove sysfs_bin_buffer. It's a security hole. - Remove checks for permissions; the VFS does that. - Validate offset & count at the top level. - Allow lower levels to return less data than was asked for. - Allocate buffer at open & free it at close, not on each read/write.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sysfs.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 3e9565e2abe1..d639e18caa91 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -16,18 +16,11 @@ struct attribute {
mode_t mode;
};
-struct sysfs_bin_buffer {
- u8 * data;
- size_t size;
- size_t count;
- loff_t offset;
-};
-
struct bin_attribute {
struct attribute attr;
size_t size;
- ssize_t (*read)(struct kobject *, struct sysfs_bin_buffer *);
- ssize_t (*write)(struct kobject *, struct sysfs_bin_buffer *);
+ ssize_t (*read)(struct kobject *, char *, loff_t, size_t);
+ ssize_t (*write)(struct kobject *, char *, loff_t, size_t);
};
struct sysfs_ops {