Skip to content

Commit 2ab1efa

Browse files
f0rm2l1ndavem330
authored andcommitted
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 5bc1701 ("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 f8ab180 ("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 <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 38894ff commit 2ab1efa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/sched/cls_api.c

+1
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,7 @@ static bool tcf_chain_dump(struct tcf_chain *chain, struct Qdisc *q, u32 parent,
27352735
}
27362736

27372737
static const struct nla_policy tcf_tfilter_dump_policy[TCA_MAX + 1] = {
2738+
[TCA_CHAIN] = { .type = NLA_U32 },
27382739
[TCA_DUMP_FLAGS] = NLA_POLICY_BITFIELD32(TCA_DUMP_FLAGS_TERSE),
27392740
};
27402741

0 commit comments

Comments
 (0)