mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
net/sched: cls_api: add missing validation of netlink attributes
Similarly to what has been done in8b4c3cdd9d
("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:5bc1701881
("net: sched: introduce multichain support for filters") Signed-off-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
58f5bbe331
commit
e331473fee
2 changed files with 12 additions and 9 deletions
|
@ -1307,10 +1307,6 @@ check_loop_fn(struct Qdisc *q, unsigned long cl, struct qdisc_walker *w)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete/get qdisc.
|
||||
*/
|
||||
|
||||
const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = {
|
||||
[TCA_KIND] = { .type = NLA_STRING },
|
||||
[TCA_OPTIONS] = { .type = NLA_NESTED },
|
||||
|
@ -1323,6 +1319,10 @@ const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = {
|
|||
[TCA_EGRESS_BLOCK] = { .type = NLA_U32 },
|
||||
};
|
||||
|
||||
/*
|
||||
* Delete/get qdisc.
|
||||
*/
|
||||
|
||||
static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue