From: wenxu wenxu@ucloud.cn
stable inclusion from stable-5.10.53 commit c3bc9ce7d400718b8341aab0f4fe86d2cf6a3715 bugzilla: 175574 https://gitee.com/openeuler/kernel/issues/I4DTUX
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=...
--------------------------------
commit 8955b90c3cdad199137809aac8ccbbb585355913 upstream.
The confirm operation should be checked. If there are any failed, the packet should be dropped like in ovs and netfilter.
Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct") Signed-off-by: wenxu wenxu@ucloud.cn Signed-off-by: David S. Miller davem@davemloft.net Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Chen Jun chenjun102@huawei.com Acked-by: Weilong Chen chenweilong@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com --- net/sched/act_ct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 7ef074c6dd16..f1088599fafd 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -1023,7 +1023,8 @@ static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a, /* This will take care of sending queued events * even if the connection is already confirmed. */ - nf_conntrack_confirm(skb); + if (nf_conntrack_confirm(skb) != NF_ACCEPT) + goto drop; }
if (!skip_add)