diff options
author | Lin Ma <linma@zju.edu.cn> | 2023-12-28 14:43:58 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-01-03 11:54:39 +0000 |
commit | 2ab1efad60ad119b616722b81eeb73060728028c (patch) | |
tree | 6ed49985da34501fc15fc255e7ceca7a1c43b0d3 /net/sched | |
parent | 38894ff3a04b7e7a3fa3d7688fa77ceb0ecd4093 (diff) | |
download | linux-stable-2ab1efad60ad119b616722b81eeb73060728028c.tar.gz linux-stable-2ab1efad60ad119b616722b81eeb73060728028c.tar.bz2 linux-stable-2ab1efad60ad119b616722b81eeb73060728028c.zip |
net/sched: cls_api: complement tcf_tfilter_dump_policy
In function `tc_dump_tfilter`, the attributes array is parsed via
tcf_tfilter_dump_policy which only describes TCA_DUMP_FLAGS. However,
the NLA TCA_CHAIN is also accessed with `nla_get_u32`.
The access to TCA_CHAIN is introduced in commit 5bc1701881e3 ("net:
sched: introduce multichain support for filters") and no nla_policy is
provided for parsing at that point. Later on, tcf_tfilter_dump_policy is
introduced in commit f8ab1807a9c9 ("net: sched: introduce terse dump
flag") while still ignoring the fact that TCA_CHAIN needs a check. This
patch does that by complementing the policy to allow the access
discussed here can be safe as other cases just choose rtm_tca_policy as
the parsing policy.
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/cls_api.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 3c50b4037755..adf5de1ff773 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -2735,6 +2735,7 @@ errout: } static const struct nla_policy tcf_tfilter_dump_policy[TCA_MAX + 1] = { + [TCA_CHAIN] = { .type = NLA_U32 }, [TCA_DUMP_FLAGS] = NLA_POLICY_BITFIELD32(TCA_DUMP_FLAGS_TERSE), }; |