diff options
author | Brian Swetland <swetland@google.com> | 2010-10-27 18:34:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-27 21:03:17 -0400 |
commit | 12aa4c64174cb0d915cd1c7b763847c0ffa8e92c (patch) | |
tree | 5dad12890f620de7f5ff6ec5255ff8cc407526c1 /drivers/w1 | |
parent | f49d2eb314f3f83270bef6aea2abb7a26d4218ee (diff) |
w1: don't allow arbitrary users to remove w1 devices
The search/pullup/add/remove device attributes were 0666 which would allow
arbitrary users to affect the 1 wire bus. Change to 0664 to prevent that.
I found this patch in the Android tree, apparently this has never been
sent upstream so doing it now.
Signed-off-by: Brian Swetland <swetland@google.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r-- | drivers/w1/w1.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 2839e281cd65..b7b5014ff714 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -517,10 +517,10 @@ static W1_MASTER_ATTR_RO(max_slave_count, S_IRUGO); | |||
517 | static W1_MASTER_ATTR_RO(attempts, S_IRUGO); | 517 | static W1_MASTER_ATTR_RO(attempts, S_IRUGO); |
518 | static W1_MASTER_ATTR_RO(timeout, S_IRUGO); | 518 | static W1_MASTER_ATTR_RO(timeout, S_IRUGO); |
519 | static W1_MASTER_ATTR_RO(pointer, S_IRUGO); | 519 | static W1_MASTER_ATTR_RO(pointer, S_IRUGO); |
520 | static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUGO); | 520 | static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUSR | S_IWGRP); |
521 | static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUGO); | 521 | static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUSR | S_IWGRP); |
522 | static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUGO); | 522 | static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUSR | S_IWGRP); |
523 | static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUGO); | 523 | static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUSR | S_IWGRP); |
524 | 524 | ||
525 | static struct attribute *w1_master_default_attrs[] = { | 525 | static struct attribute *w1_master_default_attrs[] = { |
526 | &w1_master_attribute_name.attr, | 526 | &w1_master_attribute_name.attr, |