Commit 7a52b34b authored by Or Gerlitz's avatar Or Gerlitz Committed by Roland Dreier

IPoIB: Fix world-writable child interface control sysfs attributes

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: default avatarOr Gerlitz <ogerlitz@voltaire.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 67a3e12b
...@@ -1163,7 +1163,7 @@ static ssize_t create_child(struct device *dev, ...@@ -1163,7 +1163,7 @@ static ssize_t create_child(struct device *dev,
return ret ? ret : count; 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, static ssize_t delete_child(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -1183,7 +1183,7 @@ static ssize_t delete_child(struct device *dev, ...@@ -1183,7 +1183,7 @@ static ssize_t delete_child(struct device *dev,
return ret ? ret : count; 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) int ipoib_add_pkey_attr(struct net_device *dev)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment