aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2010-05-12 21:28:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-21 12:37:31 -0400
commit2c3c8bea608866d8bd9dcf92657d57fdcac011c5 (patch)
treef509b958d0a65c46c831dbdd447a81e706dd995a /drivers/misc
parent68d75ed4b84a0806ecd4bc14da4759713b23a532 (diff)
sysfs: add struct file* to bin_attr callbacks
This allows bin_attr->read,write,mmap callbacks to check file specific data (such as inode owner) as part of any privilege validation. Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/c2port/core.c4
-rw-r--r--drivers/misc/ds1682.c6
-rw-r--r--drivers/misc/eeprom/at24.c6
-rw-r--r--drivers/misc/eeprom/at25.c6
-rw-r--r--drivers/misc/eeprom/eeprom.c3
-rw-r--r--drivers/misc/eeprom/max6875.c2
6 files changed, 17 insertions, 10 deletions
diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c
index ed090e77c9c..19fc7c1cb42 100644
--- a/drivers/misc/c2port/core.c
+++ b/drivers/misc/c2port/core.c
@@ -707,7 +707,7 @@ static ssize_t __c2port_read_flash_data(struct c2port_device *dev,
707 return nread; 707 return nread;
708} 708}
709 709
710static ssize_t c2port_read_flash_data(struct kobject *kobj, 710static ssize_t c2port_read_flash_data(struct file *filp, struct kobject *kobj,
711 struct bin_attribute *attr, 711 struct bin_attribute *attr,
712 char *buffer, loff_t offset, size_t count) 712 char *buffer, loff_t offset, size_t count)
713{ 713{
@@ -824,7 +824,7 @@ static ssize_t __c2port_write_flash_data(struct c2port_device *dev,
824 return nwrite; 824 return nwrite;
825} 825}
826 826
827static ssize_t c2port_write_flash_data(struct kobject *kobj, 827static ssize_t c2port_write_flash_data(struct file *filp, struct kobject *kobj,
828 struct bin_attribute *attr, 828 struct bin_attribute *attr,
829 char *buffer, loff_t offset, size_t count) 829 char *buffer, loff_t offset, size_t count)
830{ 830{
diff --git a/drivers/misc/ds1682.c b/drivers/misc/ds1682.c
index 9197cfc5501..a513f0aa643 100644
--- a/drivers/misc/ds1682.c
+++ b/drivers/misc/ds1682.c
@@ -140,7 +140,8 @@ static const struct attribute_group ds1682_group = {
140/* 140/*
141 * User data attribute 141 * User data attribute
142 */ 142 */
143static ssize_t ds1682_eeprom_read(struct kobject *kobj, struct bin_attribute *attr, 143static ssize_t ds1682_eeprom_read(struct file *filp, struct kobject *kobj,
144 struct bin_attribute *attr,
144 char *buf, loff_t off, size_t count) 145 char *buf, loff_t off, size_t count)
145{ 146{
146 struct i2c_client *client = kobj_to_i2c_client(kobj); 147 struct i2c_client *client = kobj_to_i2c_client(kobj);
@@ -163,7 +164,8 @@ static ssize_t ds1682_eeprom_read(struct kobject *kobj, struct bin_attribute *at
163 return count; 164 return count;
164} 165}
165 166
166static ssize_t ds1682_eeprom_write(struct kobject *kobj, struct bin_attribute *attr, 167static ssize_t ds1682_eeprom_write(struct file *filp, struct kobject *kobj,
168 struct bin_attribute *attr,
167 char *buf, loff_t off, size_t count) 169 char *buf, loff_t off, size_t count)
168{ 170{
169 struct i2c_client *client = kobj_to_i2c_client(kobj); 171 struct i2c_client *client = kobj_to_i2c_client(kobj);
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index db7d0f21b65..a79a62f7548 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -274,7 +274,8 @@ static ssize_t at24_read(struct at24_data *at24,
274 return retval; 274 return retval;
275} 275}
276 276
277static ssize_t at24_bin_read(struct kobject *kobj, struct bin_attribute *attr, 277static ssize_t at24_bin_read(struct file *filp, struct kobject *kobj,
278 struct bin_attribute *attr,
278 char *buf, loff_t off, size_t count) 279 char *buf, loff_t off, size_t count)
279{ 280{
280 struct at24_data *at24; 281 struct at24_data *at24;
@@ -395,7 +396,8 @@ static ssize_t at24_write(struct at24_data *at24, const char *buf, loff_t off,
395 return retval; 396 return retval;
396} 397}
397 398
398static ssize_t at24_bin_write(struct kobject *kobj, struct bin_attribute *attr, 399static ssize_t at24_bin_write(struct file *filp, struct kobject *kobj,
400 struct bin_attribute *attr,
399 char *buf, loff_t off, size_t count) 401 char *buf, loff_t off, size_t count)
400{ 402{
401 struct at24_data *at24; 403 struct at24_data *at24;
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index d194212a41f..c627e4174cc 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -126,7 +126,8 @@ at25_ee_read(
126} 126}
127 127
128static ssize_t 128static ssize_t
129at25_bin_read(struct kobject *kobj, struct bin_attribute *bin_attr, 129at25_bin_read(struct file *filp, struct kobject *kobj,
130 struct bin_attribute *bin_attr,
130 char *buf, loff_t off, size_t count) 131 char *buf, loff_t off, size_t count)
131{ 132{
132 struct device *dev; 133 struct device *dev;
@@ -253,7 +254,8 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off,
253} 254}
254 255
255static ssize_t 256static ssize_t
256at25_bin_write(struct kobject *kobj, struct bin_attribute *bin_attr, 257at25_bin_write(struct file *filp, struct kobject *kobj,
258 struct bin_attribute *bin_attr,
257 char *buf, loff_t off, size_t count) 259 char *buf, loff_t off, size_t count)
258{ 260{
259 struct device *dev; 261 struct device *dev;
diff --git a/drivers/misc/eeprom/eeprom.c b/drivers/misc/eeprom/eeprom.c
index e306a8cd2f9..45060ddc4e5 100644
--- a/drivers/misc/eeprom/eeprom.c
+++ b/drivers/misc/eeprom/eeprom.c
@@ -81,7 +81,8 @@ exit:
81 mutex_unlock(&data->update_lock); 81 mutex_unlock(&data->update_lock);
82} 82}
83 83
84static ssize_t eeprom_read(struct kobject *kobj, struct bin_attribute *bin_attr, 84static ssize_t eeprom_read(struct file *filp, struct kobject *kobj,
85 struct bin_attribute *bin_attr,
85 char *buf, loff_t off, size_t count) 86 char *buf, loff_t off, size_t count)
86{ 87{
87 struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); 88 struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj));
diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c
index fe290927850..5653a3ce051 100644
--- a/drivers/misc/eeprom/max6875.c
+++ b/drivers/misc/eeprom/max6875.c
@@ -107,7 +107,7 @@ exit_up:
107 mutex_unlock(&data->update_lock); 107 mutex_unlock(&data->update_lock);
108} 108}
109 109
110static ssize_t max6875_read(struct kobject *kobj, 110static ssize_t max6875_read(struct file *filp, struct kobject *kobj,
111 struct bin_attribute *bin_attr, 111 struct bin_attribute *bin_attr,
112 char *buf, loff_t off, size_t count) 112 char *buf, loff_t off, size_t count)
113{ 113{