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/firmware | |
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/firmware')
-rw-r--r-- | drivers/firmware/dcdbas.c | 4 | ||||
-rw-r--r-- | drivers/firmware/dell_rbu.c | 10 | ||||
-rw-r--r-- | drivers/firmware/efivars.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c index fb09bb3c0ad6..aa9bc9e980e1 100644 --- a/drivers/firmware/dcdbas.c +++ b/drivers/firmware/dcdbas.c | |||
@@ -149,7 +149,7 @@ static ssize_t smi_data_buf_size_store(struct device *dev, | |||
149 | return count; | 149 | return count; |
150 | } | 150 | } |
151 | 151 | ||
152 | static ssize_t smi_data_read(struct kobject *kobj, | 152 | static ssize_t smi_data_read(struct file *filp, struct kobject *kobj, |
153 | struct bin_attribute *bin_attr, | 153 | struct bin_attribute *bin_attr, |
154 | char *buf, loff_t pos, size_t count) | 154 | char *buf, loff_t pos, size_t count) |
155 | { | 155 | { |
@@ -162,7 +162,7 @@ static ssize_t smi_data_read(struct kobject *kobj, | |||
162 | return ret; | 162 | return ret; |
163 | } | 163 | } |
164 | 164 | ||
165 | static ssize_t smi_data_write(struct kobject *kobj, | 165 | static ssize_t smi_data_write(struct file *filp, struct kobject *kobj, |
166 | struct bin_attribute *bin_attr, | 166 | struct bin_attribute *bin_attr, |
167 | char *buf, loff_t pos, size_t count) | 167 | char *buf, loff_t pos, size_t count) |
168 | { | 168 | { |
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c index 3a4460265b10..2f452f1f7c8a 100644 --- a/drivers/firmware/dell_rbu.c +++ b/drivers/firmware/dell_rbu.c | |||
@@ -522,7 +522,7 @@ static ssize_t read_rbu_mono_data(char *buffer, loff_t pos, size_t count) | |||
522 | rbu_data.image_update_buffer, rbu_data.bios_image_size); | 522 | rbu_data.image_update_buffer, rbu_data.bios_image_size); |
523 | } | 523 | } |
524 | 524 | ||
525 | static ssize_t read_rbu_data(struct kobject *kobj, | 525 | static ssize_t read_rbu_data(struct file *filp, struct kobject *kobj, |
526 | struct bin_attribute *bin_attr, | 526 | struct bin_attribute *bin_attr, |
527 | char *buffer, loff_t pos, size_t count) | 527 | char *buffer, loff_t pos, size_t count) |
528 | { | 528 | { |
@@ -576,7 +576,7 @@ static void callbackfn_rbu(const struct firmware *fw, void *context) | |||
576 | release_firmware(fw); | 576 | release_firmware(fw); |
577 | } | 577 | } |
578 | 578 | ||
579 | static ssize_t read_rbu_image_type(struct kobject *kobj, | 579 | static ssize_t read_rbu_image_type(struct file *filp, struct kobject *kobj, |
580 | struct bin_attribute *bin_attr, | 580 | struct bin_attribute *bin_attr, |
581 | char *buffer, loff_t pos, size_t count) | 581 | char *buffer, loff_t pos, size_t count) |
582 | { | 582 | { |
@@ -586,7 +586,7 @@ static ssize_t read_rbu_image_type(struct kobject *kobj, | |||
586 | return size; | 586 | return size; |
587 | } | 587 | } |
588 | 588 | ||
589 | static ssize_t write_rbu_image_type(struct kobject *kobj, | 589 | static ssize_t write_rbu_image_type(struct file *filp, struct kobject *kobj, |
590 | struct bin_attribute *bin_attr, | 590 | struct bin_attribute *bin_attr, |
591 | char *buffer, loff_t pos, size_t count) | 591 | char *buffer, loff_t pos, size_t count) |
592 | { | 592 | { |
@@ -647,7 +647,7 @@ static ssize_t write_rbu_image_type(struct kobject *kobj, | |||
647 | return rc; | 647 | return rc; |
648 | } | 648 | } |
649 | 649 | ||
650 | static ssize_t read_rbu_packet_size(struct kobject *kobj, | 650 | static ssize_t read_rbu_packet_size(struct file *filp, struct kobject *kobj, |
651 | struct bin_attribute *bin_attr, | 651 | struct bin_attribute *bin_attr, |
652 | char *buffer, loff_t pos, size_t count) | 652 | char *buffer, loff_t pos, size_t count) |
653 | { | 653 | { |
@@ -660,7 +660,7 @@ static ssize_t read_rbu_packet_size(struct kobject *kobj, | |||
660 | return size; | 660 | return size; |
661 | } | 661 | } |
662 | 662 | ||
663 | static ssize_t write_rbu_packet_size(struct kobject *kobj, | 663 | static ssize_t write_rbu_packet_size(struct file *filp, struct kobject *kobj, |
664 | struct bin_attribute *bin_attr, | 664 | struct bin_attribute *bin_attr, |
665 | char *buffer, loff_t pos, size_t count) | 665 | char *buffer, loff_t pos, size_t count) |
666 | { | 666 | { |
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 81b70bd07586..2a62ec6390e0 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -402,7 +402,7 @@ efivar_unregister(struct efivar_entry *var) | |||
402 | } | 402 | } |
403 | 403 | ||
404 | 404 | ||
405 | static ssize_t efivar_create(struct kobject *kobj, | 405 | static ssize_t efivar_create(struct file *filp, struct kobject *kobj, |
406 | struct bin_attribute *bin_attr, | 406 | struct bin_attribute *bin_attr, |
407 | char *buf, loff_t pos, size_t count) | 407 | char *buf, loff_t pos, size_t count) |
408 | { | 408 | { |
@@ -461,7 +461,7 @@ static ssize_t efivar_create(struct kobject *kobj, | |||
461 | return count; | 461 | return count; |
462 | } | 462 | } |
463 | 463 | ||
464 | static ssize_t efivar_delete(struct kobject *kobj, | 464 | static ssize_t efivar_delete(struct file *filp, struct kobject *kobj, |
465 | struct bin_attribute *bin_attr, | 465 | struct bin_attribute *bin_attr, |
466 | char *buf, loff_t pos, size_t count) | 466 | char *buf, loff_t pos, size_t count) |
467 | { | 467 | { |