aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorStéphane Graber <[email protected]>2014-04-30 15:25:43 +0000
committerDavid S. Miller <[email protected]>2014-05-02 21:43:25 +0000
commit4e8bbb819d1594a01f91b1de83321f68d3e6e245 (patch)
treeb4f187161c4530eab963ee8d1e35d42366d2fa1a /net/sched/cls_api.c
parentMerge branch 'davinci_mdio' (diff)
downloadkernel-4e8bbb819d1594a01f91b1de83321f68d3e6e245.tar.gz
kernel-4e8bbb819d1594a01f91b1de83321f68d3e6e245.zip
net: Allow tc changes in user namespaces
This switches a few remaining capable(CAP_NET_ADMIN) to ns_capable so that root in a user namespace may set tc rules inside that namespace. Signed-off-by: Stéphane Graber <[email protected]> Acked-by: Serge E. Hallyn <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Jamal Hadi Salim <[email protected]> Cc: "David S. Miller" <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index a481bbe118d3..1a4a20267787 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -134,7 +134,8 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
int err;
int tp_created = 0;
- if ((n->nlmsg_type != RTM_GETTFILTER) && !capable(CAP_NET_ADMIN))
+ if ((n->nlmsg_type != RTM_GETTFILTER) &&
+ !ns_capable(net->user_ns, CAP_NET_ADMIN))
return -EPERM;
replay: