net/sched: act_ct: fix err check for nf_conntrack_confirm
authorwenxu <wenxu@ucloud.cn>
Fri, 2 Jul 2021 03:34:31 +0000 (11:34 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Jul 2021 19:07:08 +0000 (12:07 -0700)
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>
net/sched/act_ct.c

index a656baa321fe1686ac8f87f8a35819f067f65869..a62f404d0e16576beb48988494797f30290861a4 100644 (file)
@@ -1026,7 +1026,8 @@ do_nat:
                /* 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)