diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2014-03-23 21:30:34 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2014-03-23 21:51:00 -0400 |
commit | 58f86cc89c3372d3e61d5b71e5513ec5a0b02848 (patch) | |
tree | ba12cb68846c5e4e04d3442528dee70e58100859 /fs/ocfs2/stackglue.c | |
parent | c6bda7c988a57958108741cde9b1f12e9727a938 (diff) |
VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.
Summary of http://lkml.org/lkml/2014/3/14/363 :
Ted: module_param(queue_depth, int, 444)
Joe: 0444!
Rusty: User perms >= group perms >= other perms?
Joe: CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2?
Side effect of stricter permissions means removing the unnecessary
S_IFREG from several callers.
Note that the BUILD_BUG_ON_ZERO((perm) & 2) test was removed: a fair
number of drivers fail this test, so that will be the debate for a
future patch.
Suggested-by: Joe Perches <joe@perches.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> for drivers/pci/slot.c
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'fs/ocfs2/stackglue.c')
-rw-r--r-- | fs/ocfs2/stackglue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index 1324e6600e57..25e9f7b5bad3 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c | |||
@@ -494,7 +494,7 @@ static ssize_t ocfs2_max_locking_protocol_show(struct kobject *kobj, | |||
494 | } | 494 | } |
495 | 495 | ||
496 | static struct kobj_attribute ocfs2_attr_max_locking_protocol = | 496 | static struct kobj_attribute ocfs2_attr_max_locking_protocol = |
497 | __ATTR(max_locking_protocol, S_IFREG | S_IRUGO, | 497 | __ATTR(max_locking_protocol, S_IRUGO, |
498 | ocfs2_max_locking_protocol_show, NULL); | 498 | ocfs2_max_locking_protocol_show, NULL); |
499 | 499 | ||
500 | static ssize_t ocfs2_loaded_cluster_plugins_show(struct kobject *kobj, | 500 | static ssize_t ocfs2_loaded_cluster_plugins_show(struct kobject *kobj, |
@@ -526,7 +526,7 @@ static ssize_t ocfs2_loaded_cluster_plugins_show(struct kobject *kobj, | |||
526 | } | 526 | } |
527 | 527 | ||
528 | static struct kobj_attribute ocfs2_attr_loaded_cluster_plugins = | 528 | static struct kobj_attribute ocfs2_attr_loaded_cluster_plugins = |
529 | __ATTR(loaded_cluster_plugins, S_IFREG | S_IRUGO, | 529 | __ATTR(loaded_cluster_plugins, S_IRUGO, |
530 | ocfs2_loaded_cluster_plugins_show, NULL); | 530 | ocfs2_loaded_cluster_plugins_show, NULL); |
531 | 531 | ||
532 | static ssize_t ocfs2_active_cluster_plugin_show(struct kobject *kobj, | 532 | static ssize_t ocfs2_active_cluster_plugin_show(struct kobject *kobj, |
@@ -548,7 +548,7 @@ static ssize_t ocfs2_active_cluster_plugin_show(struct kobject *kobj, | |||
548 | } | 548 | } |
549 | 549 | ||
550 | static struct kobj_attribute ocfs2_attr_active_cluster_plugin = | 550 | static struct kobj_attribute ocfs2_attr_active_cluster_plugin = |
551 | __ATTR(active_cluster_plugin, S_IFREG | S_IRUGO, | 551 | __ATTR(active_cluster_plugin, S_IRUGO, |
552 | ocfs2_active_cluster_plugin_show, NULL); | 552 | ocfs2_active_cluster_plugin_show, NULL); |
553 | 553 | ||
554 | static ssize_t ocfs2_cluster_stack_show(struct kobject *kobj, | 554 | static ssize_t ocfs2_cluster_stack_show(struct kobject *kobj, |
@@ -597,7 +597,7 @@ static ssize_t ocfs2_cluster_stack_store(struct kobject *kobj, | |||
597 | 597 | ||
598 | 598 | ||
599 | static struct kobj_attribute ocfs2_attr_cluster_stack = | 599 | static struct kobj_attribute ocfs2_attr_cluster_stack = |
600 | __ATTR(cluster_stack, S_IFREG | S_IRUGO | S_IWUSR, | 600 | __ATTR(cluster_stack, S_IRUGO | S_IWUSR, |
601 | ocfs2_cluster_stack_show, | 601 | ocfs2_cluster_stack_show, |
602 | ocfs2_cluster_stack_store); | 602 | ocfs2_cluster_stack_store); |
603 | 603 | ||