From: wenxu Date: Fri, 2 Jul 2021 03:34:31 +0000 (+0800) Subject: net/sched: act_ct: fix err check for nf_conntrack_confirm X-Git-Tag: v5.4.135~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=813d45499f51d7c7992b035780dcd80315e66f51;p=thirdparty%2Fkernel%2Fstable.git net/sched: act_ct: fix err check for nf_conntrack_confirm 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 16c4cbf6d1f0a..02d4491991b5e 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -474,7 +474,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; } out_push: