Patchwork [net-next,1/4] netns: fdb: allow unprivileged users to add/del fdb entries

login
register
mail settings
Submitter Gao feng
Date Feb. 1, 2013, 2:30 a.m.
Message ID <1359685860-29636-1-git-send-email-gaofeng@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/217333/
State Accepted
Delegated to: David Miller
Headers show

Comments

Gao feng - Feb. 1, 2013, 2:30 a.m.
Right now,only ixgdb,macvlan,vxlan and bridge implement
fdb_add/fdb_del operations.

these operations only operate the private data of net
device. So allowing the unprivileged users who creates
the userns and netns to add/del fdb entries will do no
harm to other netns.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 net/core/rtnetlink.c | 6 ------
 1 file changed, 6 deletions(-)
David Miller - Feb. 4, 2013, 6:12 p.m.
From: Gao feng <gaofeng@cn.fujitsu.com>
Date: Fri, 1 Feb 2013 10:30:57 +0800

> Right now,only ixgdb,macvlan,vxlan and bridge implement
> fdb_add/fdb_del operations.
> 
> these operations only operate the private data of net
> device. So allowing the unprivileged users who creates
> the userns and netns to add/del fdb entries will do no
> harm to other netns.
> 
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 9a419b0..c1e4db6 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2058,9 +2058,6 @@  static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 	u8 *addr;
 	int err;
 
-	if (!capable(CAP_NET_ADMIN))
-		return -EPERM;
-
 	err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL);
 	if (err < 0)
 		return err;
@@ -2127,9 +2124,6 @@  static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 	int err = -EINVAL;
 	__u8 *addr;
 
-	if (!capable(CAP_NET_ADMIN))
-		return -EPERM;
-
 	if (nlmsg_len(nlh) < sizeof(*ndm))
 		return -EINVAL;