[openib-general] [PATCH] IPoIB: Only allow root to change between datagram and connected mode

Roland Dreier rdreier at cisco.com
Wed Feb 14 14:16:28 PST 2007


Change the permissions of the "mode" sysfs attribute to be S_IWUSR
instead of S_IWUGO.

Signed-off-by: Roland Dreier <rolandd at cisco.com>
---
FYI -- I'm planning to merge this for 2.6.21.  It doesn't seem
appropriate to allow ordinary users to mess with this sort of config.

 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 2d48387..8881a71 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1138,7 +1138,7 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
 	return -EINVAL;
 }
 
-static DEVICE_ATTR(mode, S_IWUGO | S_IRUGO, show_mode, set_mode);
+static DEVICE_ATTR(mode, S_IWUSR | S_IRUGO, show_mode, set_mode);
 
 int ipoib_cm_add_mode_attr(struct net_device *dev)
 {
-- 
1.4.4.4




More information about the general mailing list