diff options
author | Chris Wright <chrisw@sous-sol.org> | 2010-05-12 21:28:57 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-21 12:37:31 -0400 |
commit | 2c3c8bea608866d8bd9dcf92657d57fdcac011c5 (patch) | |
tree | f509b958d0a65c46c831dbdd447a81e706dd995a /drivers/base/firmware_class.c | |
parent | 68d75ed4b84a0806ecd4bc14da4759713b23a532 (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/base/firmware_class.c')
-rw-r--r-- | drivers/base/firmware_class.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index d98e424675cf..3f093b0dd217 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -278,8 +278,9 @@ static ssize_t firmware_loading_store(struct device *dev, | |||
278 | static DEVICE_ATTR(loading, 0644, firmware_loading_show, firmware_loading_store); | 278 | static DEVICE_ATTR(loading, 0644, firmware_loading_show, firmware_loading_store); |
279 | 279 | ||
280 | static ssize_t | 280 | static ssize_t |
281 | firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr, | 281 | firmware_data_read(struct file *filp, struct kobject *kobj, |
282 | char *buffer, loff_t offset, size_t count) | 282 | struct bin_attribute *bin_attr, char *buffer, loff_t offset, |
283 | size_t count) | ||
283 | { | 284 | { |
284 | struct device *dev = to_dev(kobj); | 285 | struct device *dev = to_dev(kobj); |
285 | struct firmware_priv *fw_priv = dev_get_drvdata(dev); | 286 | struct firmware_priv *fw_priv = dev_get_drvdata(dev); |
@@ -362,6 +363,7 @@ fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size) | |||
362 | 363 | ||
363 | /** | 364 | /** |
364 | * firmware_data_write - write method for firmware | 365 | * firmware_data_write - write method for firmware |
366 | * @filp: open sysfs file | ||
365 | * @kobj: kobject for the device | 367 | * @kobj: kobject for the device |
366 | * @bin_attr: bin_attr structure | 368 | * @bin_attr: bin_attr structure |
367 | * @buffer: buffer being written | 369 | * @buffer: buffer being written |
@@ -372,8 +374,9 @@ fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size) | |||
372 | * the driver as a firmware image. | 374 | * the driver as a firmware image. |
373 | **/ | 375 | **/ |
374 | static ssize_t | 376 | static ssize_t |
375 | firmware_data_write(struct kobject *kobj, struct bin_attribute *bin_attr, | 377 | firmware_data_write(struct file* filp, struct kobject *kobj, |
376 | char *buffer, loff_t offset, size_t count) | 378 | struct bin_attribute *bin_attr, char *buffer, |
379 | loff_t offset, size_t count) | ||
377 | { | 380 | { |
378 | struct device *dev = to_dev(kobj); | 381 | struct device *dev = to_dev(kobj); |
379 | struct firmware_priv *fw_priv = dev_get_drvdata(dev); | 382 | struct firmware_priv *fw_priv = dev_get_drvdata(dev); |