未验证 提交 b68be3a4 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!1568 net/sched: cls_u32: Fix reference counter leak leading to overflow

Merge Pull Request from: @ci-robot 
 
PR sync from: Lu Wei <luwei32@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/6L365ADXKYRWFSYG3HPROXFVPSGHUTTY/ 
 
https://gitee.com/src-openeuler/kernel/issues/I7N3N2 
 
Link:https://gitee.com/openeuler/kernel/pulls/1568 

Reviewed-by: Yue Haibing <yuehaibing@huawei.com> 
Signed-off-by: Liu YongQiang <liuyongqiang13@huawei.com> 
...@@ -778,11 +778,22 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp, ...@@ -778,11 +778,22 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
int err; int err;
#ifdef CONFIG_NET_CLS_IND
int ifindex = -1;
#endif
err = tcf_exts_validate(net, tp, tb, est, &n->exts, ovr, extack); err = tcf_exts_validate(net, tp, tb, est, &n->exts, ovr, extack);
if (err < 0) if (err < 0)
return err; return err;
#ifdef CONFIG_NET_CLS_IND
if (tb[TCA_U32_INDEV]) {
ifindex = tcf_change_indev(net, tb[TCA_U32_INDEV], extack);
if (ifindex < 0)
return -EINVAL;
}
#endif
if (tb[TCA_U32_LINK]) { if (tb[TCA_U32_LINK]) {
u32 handle = nla_get_u32(tb[TCA_U32_LINK]); u32 handle = nla_get_u32(tb[TCA_U32_LINK]);
struct tc_u_hnode *ht_down = NULL, *ht_old; struct tc_u_hnode *ht_down = NULL, *ht_old;
...@@ -814,13 +825,8 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp, ...@@ -814,13 +825,8 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp,
} }
#ifdef CONFIG_NET_CLS_IND #ifdef CONFIG_NET_CLS_IND
if (tb[TCA_U32_INDEV]) { if (ifindex >= 0)
int ret; n->ifindex = ifindex;
ret = tcf_change_indev(net, tb[TCA_U32_INDEV], extack);
if (ret < 0)
return -EINVAL;
n->ifindex = ret;
}
#endif #endif
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册