diff options
author | Zhengchao Shao <shaozhengchao@huawei.com> | 2022-08-19 12:18:54 +0800 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-08-23 10:18:26 +0200 |
commit | ab4850819176a92864f6ebd6c932ed926a337054 (patch) | |
tree | aa88c1306f30cab41f72c95cb17d241dd5b84178 /net/sched/cls_api.c | |
parent | 97d29b9231c73d8c2c1c5b6add6d1f679bb579f9 (diff) | |
download | linux-ab4850819176a92864f6ebd6c932ed926a337054.tar.gz linux-ab4850819176a92864f6ebd6c932ed926a337054.tar.bz2 linux-ab4850819176a92864f6ebd6c932ed926a337054.zip |
net: sched: remove duplicate check of user rights in qdisc
In rtnetlink_rcv_msg function, the permission for all user operations
is checked except the GET operation, which is the same as the checking
in qdisc. Therefore, remove the user rights check in qdisc.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Message-Id: <20220819041854.83372-1-shaozhengchao@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 790d6809be81..1ebab4b11262 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -1977,9 +1977,6 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n, bool rtnl_held = false; u32 flags; - if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) - return -EPERM; - replay: tp_created = 0; @@ -2208,9 +2205,6 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n, int err; bool rtnl_held = false; - if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) - return -EPERM; - err = nlmsg_parse_deprecated(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); if (err < 0) @@ -2826,10 +2820,6 @@ static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n, unsigned long cl; int err; - if (n->nlmsg_type != RTM_GETCHAIN && - !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) - return -EPERM; - replay: q = NULL; err = nlmsg_parse_deprecated(n, sizeof(*t), tca, TCA_MAX, |