]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:18:51 +0000 (10:18 -0700)
commit 7a52b34b07122ff5f45258d47f260f8a525518f0 upstream.

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>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/infiniband/ulp/ipoib/ipoib_main.c

index e9ca3cb57d5219960f9f67adf7eadb19dabc206e..fb97c42bcda8bbe8ce8e2b058008bc2c03b0679a 100644 (file)
@@ -1158,7 +1158,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,
@@ -1178,7 +1178,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)
 {