diff options
author | Davide Caratti <dcaratti@redhat.com> | 2018-10-10 16:00:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-16 00:48:44 -0400 |
commit | e331473fee3d500bb0d2582a1fe598df3326d8cd (patch) | |
tree | 5233db75fb1b9795b27e8cca5c5981a076f8427e /net/sched/sch_api.c | |
parent | 58f5bbe331c566f49c9559568f982202a278aa78 (diff) |
net/sched: cls_api: add missing validation of netlink attributes
Similarly to what has been done in 8b4c3cdd9dd8 ("net: sched: Add policy
validation for tc attributes"), fix classifier code to add validation of
TCA_CHAIN and TCA_KIND netlink attributes.
tested with:
# ./tdc.py -c filter
v2: Let sch_api and cls_api share nla_policy they have in common, thanks
to David Ahern.
v3: Avoid EXPORT_SYMBOL(), as validation of those attributes is not done
by TC modules, thanks to Cong Wang.
While at it, restore the 'Delete / get qdisc' comment to its orginal
position, just above tc_get_qdisc() function prototype.
Fixes: 5bc1701881e39 ("net: sched: introduce multichain support for filters")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 85e73f48e48f..6684641ea344 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -1307,10 +1307,6 @@ check_loop_fn(struct Qdisc *q, unsigned long cl, struct qdisc_walker *w) | |||
1307 | return 0; | 1307 | return 0; |
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | /* | ||
1311 | * Delete/get qdisc. | ||
1312 | */ | ||
1313 | |||
1314 | const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = { | 1310 | const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = { |
1315 | [TCA_KIND] = { .type = NLA_STRING }, | 1311 | [TCA_KIND] = { .type = NLA_STRING }, |
1316 | [TCA_OPTIONS] = { .type = NLA_NESTED }, | 1312 | [TCA_OPTIONS] = { .type = NLA_NESTED }, |
@@ -1323,6 +1319,10 @@ const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = { | |||
1323 | [TCA_EGRESS_BLOCK] = { .type = NLA_U32 }, | 1319 | [TCA_EGRESS_BLOCK] = { .type = NLA_U32 }, |
1324 | }; | 1320 | }; |
1325 | 1321 | ||
1322 | /* | ||
1323 | * Delete/get qdisc. | ||
1324 | */ | ||
1325 | |||
1326 | static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, | 1326 | static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, |
1327 | struct netlink_ext_ack *extack) | 1327 | struct netlink_ext_ack *extack) |
1328 | { | 1328 | { |