[SRU][N][PATCH 1/1] Revert "netfilter: conntrack: fix erronous removal of offload bit"

Gerald Yang gerald.yang at canonical.com
Tue Apr 21 06:29:22 UTC 2026


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

This reverts commit b2ba1678debebb1ce9104d3d028f942464ddc031.

This commit causes a regression, all nodes on PS6/7 running with this
commit hit soft lockup every 1-2 days, and need a reboot to recover.

This commit is a follow-up fix for:
netfilter: conntrack: rework offload nf_conn timeout extension logic

But the call path and logic between these two commits are changed,
and it's not a clean cherry-pick. Only backport this commit without
the changes in the middle causes soft lockup issue, and the commit
message says what it fixes is harmless.

We have run a test kernel without this commit for almost 2 weeks
without hitting soft lockup. So we need to revert it.

Signed-off-by: Gerald Yang <gerald.yang at canonical.com>
---
 net/netfilter/nf_flow_table_core.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
index 7968cabd8f32..96f29f80d1bd 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -343,8 +343,8 @@ static void flow_offload_del(struct nf_flowtable *flow_table,
 void flow_offload_teardown(struct flow_offload *flow)
 {
 	clear_bit(IPS_OFFLOAD_BIT, &flow->ct->status);
-	if (!test_and_set_bit(NF_FLOW_TEARDOWN, &flow->flags))
-		flow_offload_fixup_ct(flow->ct);
+	set_bit(NF_FLOW_TEARDOWN, &flow->flags);
+	flow_offload_fixup_ct(flow->ct);
 }
 EXPORT_SYMBOL_GPL(flow_offload_teardown);
 
@@ -518,12 +518,10 @@ static void nf_flow_offload_gc_step(struct nf_flowtable *flow_table,
 
 	if (nf_flow_has_expired(flow) ||
 	    nf_ct_is_dying(flow->ct) ||
-	    nf_flow_custom_gc(flow_table, flow)) {
+	    nf_flow_custom_gc(flow_table, flow))
 		flow_offload_teardown(flow);
-		teardown = true;
-	} else if (!teardown) {
+	else if (!teardown)
 		nf_flow_table_extend_ct_timeout(flow->ct);
-	}
 
 	if (teardown) {
 		if (test_bit(NF_FLOW_HW, &flow->flags)) {
-- 
2.43.0




More information about the kernel-team mailing list