IPoIB: Fix world-writable child interface control sysfs attributes
authorOr Gerlitz <ogerlitz@voltaire.com>
Sun, 6 Jun 2010 04:59:16 +0000 (04:59 +0000)
committerRoland Dreier <rolandd@cisco.com>
Tue, 6 Jul 2010 21:23:22 +0000 (14:23 -0700)
Sumeet Lahorani <sumeet.lahorani@oracle.com> reported that the IPoIB
child entries are world-writable; however we don't want ordinary users
to be able to create and destroy child interfaces, so fix them to be
writable only by root.

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Cc: <stable@kernel.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/ipoib/ipoib_main.c

index df3eb8c9fd96adf7e0b9cc8496bfce760ad6952d..b4b22576f12a0a0aba0c99f421fcdf7cd2699016 100644 (file)
@@ -1163,7 +1163,7 @@ static ssize_t create_child(struct device *dev,
 
        return ret ? ret : count;
 }
-static DEVICE_ATTR(create_child, S_IWUGO, NULL, create_child);
+static DEVICE_ATTR(create_child, S_IWUSR, NULL, create_child);
 
 static ssize_t delete_child(struct device *dev,
                            struct device_attribute *attr,
@@ -1183,7 +1183,7 @@ static ssize_t delete_child(struct device *dev,
        return ret ? ret : count;
 
 }
-static DEVICE_ATTR(delete_child, S_IWUGO, NULL, delete_child);
+static DEVICE_ATTR(delete_child, S_IWUSR, NULL, delete_child);
 
 int ipoib_add_pkey_attr(struct net_device *dev)
 {