From mboxrd@z Thu Jan 1 00:00:00 1970 From: Or Gerlitz Subject: Re: sysfs IPoIB root owned writable files Date: Thu, 24 Jun 2010 09:15:40 +0300 Message-ID: <4C22F80C.90000@voltaire.com> References: <4C082598.8000809@oracle.com> <4C0B2B24.6020304@Voltaire.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C0B2B24.6020304-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Roland Dreier Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org >> the following files created under /sys which are world writeable >> /sys/class/net/ib0/delete_child /sys/class/net/ib0/create_child >> At least the create_child & delete_child files appear to be dangerous to leave as world writeable because they result in resources allocations. Roland, If I see a patch in linux-rdma patchwork, e.g https://patchwork.kernel.org/patch/104502 with the below patch, does this mean it will get to be reviewed/merged towards 2.6.36, or you prefer a reminder on the list? Or. > Yes, this looks bad. The below patch fixes that, I tested it on 2.6.35-rc1 > > [PATCH] make ipoib child entries non-world writable > > Sumeet Lahorani reported that the ipoib > child entries are world writable, fix them to be root only writable > > Signed-off-by: Or Gerlitz > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c > index df3eb8c..b4b2257 100644 > --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c > +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c > @@ -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) > { -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html