[SRU][F:linux-bluefield][PATCH] net/sched: act_ct: fix err check for nf_conntrack_confirm

Bodong Wang bodong at nvidia.com
Tue Jul 6 20:12:43 UTC 2021


From: wenxu <wenxu at ucloud.cn>

BugLink: https://bugs.launchpad.net/bugs/1934819

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 at ucloud.cn>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 8955b90c3cdad199137809aac8ccbbb585355913)
https://patchwork.kernel.org/project/netdevbpf/patch/1625196871-2780-1-git-send-email-wenxu@ucloud.cn/
Signed-off-by: Bodong Wang <bodong at nvidia.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 43c5b3f..6299214 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -1004,7 +1004,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)
-- 
1.8.3.1




More information about the kernel-team mailing list