w1: don't allow arbitrary users to remove w1 devices
authorBrian Swetland <swetland@google.com>
Mon, 23 Nov 2009 14:41:42 +0000 (06:41 -0800)
committerArve Hjønnevåg <arve@android.com>
Thu, 4 Feb 2010 05:27:00 +0000 (21:27 -0800)
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.

Signed-off-by: Brian Swetland <swetland@google.com>
drivers/w1/w1.c

index acc7e3b7fe17bbbe37e024bde8db85ba738f4672..db7b6198f1522dfb27be23f7bfcef47db952cbc1 100644 (file)
@@ -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,