]> Pileus Git - ~andy/linux/blobdiff - net/sched/cls_api.c
net: Push capable(CAP_NET_ADMIN) into the rtnl methods
[~andy/linux] / net / sched / cls_api.c
index 7ae02892437c25bf1e925d6dc756ed23aabff1a3..ff55ed6c49b24115f4dc78b505da368a34e06b6b 100644 (file)
@@ -139,6 +139,8 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
        int err;
        int tp_created = 0;
 
+       if ((n->nlmsg_type != RTM_GETTFILTER) && !capable(CAP_NET_ADMIN))
+               return -EPERM;
 replay:
        t = nlmsg_data(n);
        protocol = TC_H_MIN(t->tcm_info);