Skip to content

Commit

Permalink
w1: don't allow arbitrary users to remove w1 devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brian Swetland authored and Linus Torvalds committed Oct 28, 2010
1 parent f49d2eb commit 12aa4c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/w1/w1.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,10 @@ static W1_MASTER_ATTR_RO(max_slave_count, S_IRUGO);
static W1_MASTER_ATTR_RO(attempts, S_IRUGO);
static W1_MASTER_ATTR_RO(timeout, S_IRUGO);
static W1_MASTER_ATTR_RO(pointer, S_IRUGO);
static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUGO);
static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUGO);
static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUGO);
static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUGO);
static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUSR | S_IWGRP);
static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUSR | S_IWGRP);
static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUSR | S_IWGRP);
static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUSR | S_IWGRP);

static struct attribute *w1_master_default_attrs[] = {
&w1_master_attribute_name.attr,
Expand Down

0 comments on commit 12aa4c6

Please sign in to comment.