🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11685

[PATCH net 05/12] netfilter: flowtable: extend ct timeout of offloaded GRE flows

#11685
From: Pablo Neira Ayuso
Date: Thu, 05 Nov 2026 12:45
67 lines
11210 bytes
From: Michail Andreas Michalopoulos <mike.michalo@gmail.com>

Since commit 03428ca5cee9 ("netfilter: conntrack: rework offload nf_conn
timeout extension logic"), the flowtable gc worker extends the timeout
of an offloaded conntrack entry from nf_flow_table_extend_ct_timeout()
once it falls below 5 minutes. That function only knows about TCP and
UDP and hits WARN_ON_ONCE() for any other layer 4 protocol. However,
GRE flows can be offloaded too, both via nft_flow_offload and act_ct,
since commit 4e8d9584d154 ("netfilter: flowtable: Support GRE").

The timeout of an offloaded GRE entry drops below that threshold as soon
as a packet of the flow still goes through conntrack. With ip6gre
tunnels using the default encapsulation limit this is ordinary traffic:
the flowtable does not parse the Destination Options header in front of
GRE, so every packet of the flow takes the classic forwarding path. It
also happens for a packet with ttl <= 1, which the flowtable fast path
passes up to the classic forwarding path. nf_conntrack_gre_packet() then
refreshes ct->timeout to the GRE stream timeout (180 seconds by default),
and the next gc run triggers, as reported by syzbot:

  WARNING: net/netfilter/nf_flow_table_core.c:553 at nf_flow_table_extend_ct_timeout+0x1ee/0x2f0
  Workqueue: events_power_efficient nf_flow_offload_work_gc
  Call Trace:
   nf_flow_offload_gc_step+0x545/0x7b0
   nf_flow_table_iterate+0x13c/0x1f0
   nf_flow_offload_work_gc+0x22/0x70
   process_scheduled_works+0xc3d/0x1630
   worker_thread+0xa47/0xfb0
   kthread+0x38b/0x480

Besides the splat, which panics the machine with panic_on_warn, the
default branch sets the new timeout to 1 jiffy, so the conntrack entry
expires right away and the offloaded flow is torn down.

Handle GRE like UDP and extend the timeout to NF_CT_DAY. GRE conntrack
has no protocol state to take into account, and NF_CT_DAY is also what
flow_offload_add() already sets for every offloaded entry, GRE included.
This also restores the behaviour from before commit 03428ca5cee9, when
the conntrack gc worker extended offloaded entries of any protocol to
NF_CT_DAY.

Fixes: 03428ca5cee9 ("netfilter: conntrack: rework offload nf_conn timeout extension logic")
Reported-by: syzbot+521f7e7e2b974abde99a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=521f7e7e2b974abde99a
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_flow_table_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
index 0d72dc8ae47a..2aa2647ed9df 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -544,6 +544,7 @@ static void nf_flow_table_extend_ct_timeout(struct nf_conn *ct)
 
 		switch (l4proto) {
 		case IPPROTO_UDP:
+		case IPPROTO_GRE:
 			new_timeout = NF_CT_DAY;
 			break;
 		case IPPROTO_TCP:
-- 
2.47.3
Technical Details
Message-ID: <20261105124536.1009301-6-pablo@netfilter.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357330-linux-kernel-netdev=dewy.ru
References: <20261105124536.1009301-1-pablo@netfilter.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357330-linux-kernel-netdev=dewy.ru
From: pablo@netfilter.org (Pablo Neira Ayuso)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 05/12] netfilter: flowtable: extend ct timeout of offloaded GRE flows
Date: Thu,  5 Nov 2026 13:45:29 +0100
Organization: Usenet Network
Message-ID: <20261105124536.1009301-6-pablo@netfilter.org>
References: <20261105124536.1009301-1-pablo@netfilter.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3639782"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:0bjirG+fpoE26dU6AiaC2RZgvi4= sha256:weq3xUmHtg48dOSFBEDRFrPbEvYmAfaVC7dtjNDW4Xg=
	sha1:vw5uO4nD9CviEUFn179he+NPPUc= sha256:++EpYfG2yX9avmeUnMDd5totwK/G6ARwIU/Z2RXPYBY=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 608AF112F83; Thu,  5 Nov 2026 15:53:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=netfilter.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id qmGlC9329oUh;
	Thu,  5 Nov 2026 15:53:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-357330-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=netfilter.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 92709112F7B; Thu,  5 Nov 2026 15:53:24 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id DC0853B183; Thu,  5 Nov 2026 12:46:01 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1793882750;
	b=I1tVDYxQ5ZJF83AWSfzgk48jyJ67OLf3hIT40PGh7H03vl7+AMy0By2oYktIwWJsPgFx
	 ymdOz41Un7Xpftn/755gZhr8IxBh364br4NkGmzWwH1OlXLP5j4j8iQW3wBCFoPP/5lFq
	 EWe7Q2NI8U1v1g8dPDbm0b3bgHgT9At6lq0QYu0n9HKWVPjEd/m1MT6HM6RkEYNMI3OkG
	 a/jD0gNajf0gptsuO+1AzWS8fVIZYX6hyOpJZtCq8uJIfwEb5Z1WO1JhlZvjAL1ctHqIw
	 QdsgsWd2bGCCYl2hznhzEvtlpyyZAwgZhnbZEThY0NVvlK2TKSseNY+N6Uq9Ud3Pz0A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793882750;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To:
	 Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=fo470PP63+10tqzrhqq++24kquyeboFFql2psSvwEeM=;
	b=1FQUofjgmdtvPHq0replu+7QPPYdDBllBt+NjiPEKnelgPQvCVSel+YL0MrwL1/E1J89
	 7TtMMHabjswo1KqhaoTJrOwZH6AaE3823R2NIdkMLaB4OU2b5DMcQKOy420GfUsFcNGU6
	 l38sVn/h6Rsq7vel0/13XxTl3+/qjUey4N0+Dbto+Em+11ZayU8/by2+H/zZe7fjQ2UFW
	 TG63p41Ov9pJt2XuJR0QfwMvKdtOSFflwLEE1VLXMLLqIUeUYQv1HYLZmL+IaTecnoJYS
	 vLmxCJm+44hKsYRZO3MDUWHZFKtGbhesauPFUJhEJSto9V/392JW4WZxzAJl37BmCYw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=DGsMmcdH;
	dmarc=none header.from=netfilter.org;
	spf=pass smtp.mailfrom=netfilter.org;
	arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 06138606D823;
	Thu,  5 Nov 2026 12:45:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=DGsMmcdH
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793882749;
	b=SNh6vuWPZ72Xa9BMrfPFKm10It9Fzf33XA+ZiimVOol98W3xMbLz6EugsMDIh0z2jf9n
	 ElplqeAm9WAgDpou7gr72jB8ei7QYTxOnrcm42cMVcdk+ujHMS84mM2HuNmV1AqoAHlBK
	 0+6j9w0UDcBu7ZHYPqlg5AgqnlogKHcPb3X0ptdBuG7kp166zm/hCgj6J45LdqAKi4sNu
	 pYTB2kgZjp3vFuHD33vAyGUGjSfJGQjlvhBK3m7mG+7RwOOdFMsHQx3HeEsu3mQAgcZ+p
	 jhgLa2CUrQ7Abz6xElnNDO8yMbHIO1mMcFRcX3Lbey3qG89zgAq+004Ue+dznNHzTbA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793882749;
	h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:X-Spam-Status:X-Spam-Checker-Version;
	bh=fo470PP63+10tqzrhqq++24kquyeboFFql2psSvwEeM=;
	b=BbDeXYGGB1r3s/23cH9HSjg305Yl5qCf3CUkisjyng9U69GBoPOERCwjIduJzpXpO52u
	 SraoYQgqkw93zn1tDRdSjTIhmT4pCYfqm3iEogvjBZ9pHWic5S6sIFVBXq0uquJ9iSnec
	 N4BvXi7GLPBqJzAubECNs7FjHRj2ng/xNdJA9A8yDJ3FGx1AMnbK5PwegYa1c1WBps4Ys
	 /bjjI5Od+tLmf3g3/dR5b8D+8UA+vjSIlFCVbMBMl7QzWcEDKHKzpN/Xkh1o65wcwt7S+
	 J6drxgYjyKDhygaPlXasaQLokdpGRLtZ+xXIo332UyAqX6pU2Qj95Aq0s7YPKYqY78w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=netfilter.org;
	spf=pass smtp.mailfrom=netfilter.org;
	dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=DGsMmcdH;
	arc=none smtp.remote-ip=217.70.190.124
X-Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88212606D816;
	Thu,  5 Nov 2026 12:45:48 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 88212606D816
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org;
	s=2025; t=1793882746;
	bh=fo470PP63+10tqzrhqq++24kquyeboFFql2psSvwEeM=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=DGsMmcdHoKL8xVHG8+kp8ClMp8MkqdFzmUiSJJDQJfHjj68lC/Mkmg2M7EfsbRYc8
	 PesgJpNGAhjpysoZoXxHXXT9OV12St377FffBejUvaLMvRrrMG9UY1/3xz717Ysk2v
	 PwUu9+3pL8hzi05/4foZwBfg0Gaw3iYcA5jh8oXBLWY8YtOwFxDTpcVKat2acT25+L
	 aJeXxfzkvNHCqvBp980pHjdE9iaU7vG6le+f5JkcxhNxTHn4dO19bQOrSp0zAH0HAd
	 xGlmZcvaOct5HvO7Knd7jNVyeh8PHYlYABCOb9zqlEI1ItAUD8wWxgWHf8D+UmrpPb
	 ACiQo0H9ZcJNA==
X-Received: from localhost.localdomain (mail-agni [217.70.190.124])
	by mail.netfilter.org (Postfix) with ESMTPSA id 785AC60096;
	Thu,  5 Nov 2026 13:45:46 +0100 (CET)
X-Cc: davem@davemloft.net,
	netdev@vger.kernel.org,
	kuba@kernel.org,
	pabeni@redhat.com,
	edumazet@kernel.org,
	horms@kernel.org,
	fw@strlen.de,
	ja@ssi.bg
X-Mailer: git-send-email 2.47.3
X-In-Reply-To: <20261105124536.1009301-1-pablo@netfilter.org>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list