🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23489

[PATCH] netfilter: nft_synproxy: only handle a plain SYN or a plain ACK

#23489
From: "syzbot"
Date: Fri, 27 Nov 2026 10:50
58 lines
9956 bytes
From: Krystian Kaniewski <krystianmkaniewski@gmail.com>

nft_synproxy_eval_v4() and nft_synproxy_eval_v6() check tcp->syn and
tcp->ack without excluding other TCP control flags, unlike the xtables
SYNPROXY targets. As a result, a SYN+ACK (or SYN+FIN / SYN+RST) packet
reaching nft_synproxy is misidentified as an initial client SYN and
triggers another SYN+ACK reply, while FIN+ACK and RST+ACK packets enter the
client ACK branch and can be dropped with NF_DROP instead of continuing
through the ruleset.

On loopback, when an nftables input rule evaluates nft_synproxy, a local
SYN causes it to send a SYN+ACK back over loopback, which hits the same
rule again and matches tcp->syn. This creates an infinite SYN+ACK feedback
loop in softirq context that saturates the CPUs, starves tasks holding or
waiting on rtnl_mutex, and triggers hung task warnings (such as "INFO: task
kworker/R-ipv6_:60 blocked for more than 143 seconds" in
addrconf_dad_work).

Fix this in nft_synproxy_do_eval() by returning early when tcp->syn ==
tcp->ack || tcp->fin || tcp->rst before dispatching to
nft_synproxy_eval_v4() or nft_synproxy_eval_v6(). This ensures nft_synproxy
only handles a plain SYN or a plain ACK (without FIN or RST), while valid
TCP segments outside the client handshake such as SYN+ACK, FIN+ACK, and
RST+ACK—as well as other segments with FIN, RST, or neither SYN nor ACK
set—continue through the ruleset unchanged with regs->verdict.code left as
NFT_CONTINUE.

Fixes: ad49d86e07a4 ("netfilter: nf_tables: Add synproxy support")
Assisted-by: Gemini:gemini-4-hydrogen Gemini:gemini-3.8-flash syzbot
Reported-by: syzbot+55141a0ffa0d17f01c71@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=55141a0ffa0d17f01c71
Link: https://syzkaller.appspot.com/ai_job?id=19d80d6e-8025-483e-ac1b-da92f0b2dde3
Signed-off-by: Krystian Kaniewski <krystianmkaniewski@gmail.com>

---
diff --git a/net/netfilter/nft_synproxy.c b/net/netfilter/nft_synproxy.c
index 554a96a00..aa8dea698 100644
--- a/net/netfilter/nft_synproxy.c
+++ b/net/netfilter/nft_synproxy.c
@@ -137,6 +137,9 @@ static void nft_synproxy_do_eval(const struct nft_synproxy *priv,
 		return;
 	}
 
+	if (tcp->syn == tcp->ack || tcp->fin || tcp->rst)
+		return;
+
 	switch (skb->protocol) {
 	case htons(ETH_P_IP):
 		nft_synproxy_eval_v4(priv, regs, pkt, tcp, &_tcph, &opts);


base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
-- 
See https://goo.gle/syzbot-ai-patches for information about AI-generated patches.
The person who has signed off on the patch is responsible for
addressing comments.
syzbot engineers can be reached at syzkaller@googlegroups.com.
Technical Details
Message-ID: <4feea54c-bd91-4ff1-aae5-9ba4bb835449@mail.kernel.org>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372667-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372667-linux-kernel-netdev=dewy.ru
From: syzbot@kernel.org ("syzbot")
Newsgroups: linux.kernel.netdev
Subject: [PATCH] netfilter: nft_synproxy: only handle a plain SYN or a plain ACK
Date: Fri, 27 Nov 2026 10:50:14 +0000 (UTC)
Organization: Usenet Network
Message-ID: <4feea54c-bd91-4ff1-aae5-9ba4bb835449@mail.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="712585"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:R6FgQjprYQG1k9AMPqYWbX/3AWE= sha256:IcxKPtLl0iIaBvprf50+0Lv/3sA7lck9Jlhu/0N1XPc=
	sha1:2E3/LmU14I48kp9oYg0FJHt9sRg= sha256:2sdU62L5h+KJ+Vd0FTkNxu/5lhk27vquJX2RXi10mt0=
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 90961125F50; Fri, 27 Nov 2026 13:50:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.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 B-ZEhR6g4gKG;
	Fri, 27 Nov 2026 13:50:31 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372667-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id A7C75125F48; Fri, 27 Nov 2026 13:50:20 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id C68E22B53F; Fri, 27 Nov 2026 10:50:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795776616;
	b=GxNspTtI44YIuDfgLR6Duc2kbvtisvjORE2DR07ibAaRX8ihuUqc08vn+jRXHe2vQD+v
	 hzY+9fJxPqCFrTWN7qfdAJrctiSDAGI7bjVgmfaeXqYEAhYFSG/42ZZA7UVFQnaOIs6IV
	 C+fsfqYlnZ79IyWIPayj1YAaGeIduvc0A0muN9IKoDuP3rSCM//p7tbafl5vgcKpOyzQI
	 huO87asQbBEpygVK0PlJaUFk//gy4PvpKI3trPCGmyXGUZ+MoDAVOobnSQ7GOkwnxaUzR
	 FB8e2ZccF57NlZn29Nple7Z9BoZ7g2S9ue10U1YizB3sJt1O/AIeYIiTBM8poP2CkZA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795776616;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Message-ID:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding:Date;
	bh=m1xJ2jZz3LYgTQ/9T2l2tE7BsbSdo/loePkJzVMlzsg=;
	b=E74acVFbVXOyG6GXZ1MIsAqEjvuQTgBiVJ0f5juDdvKG/RHTXn9L10zStRFQ3TovihBx
	 aSVzfrAGhx7R5g7sv1PdKXrIjEv2qFhmavGWQ1ij/6HFfXRY6fce7qKg/6DTpZhIAIUP+
	 WmGBxPB3J2IE0tKGO55az8uMPriQXABU4PcjmHLyav8ZKc3o6NdViBw7+aWo/vDg4C+ug
	 LbWvbRj1OmNQxBUGgFKcnKruCRk9Qm7ONN/sQLd3I3Qm6mbDoUC4P5zg9w1p8YPBBA/Wd
	 QcNcMrn+fXwANzY8pijsKZ2JlSH/32bfGGkCRh+IiEkmV4JHgekunY4rgJGCj2KG1zg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZRufHj86;
	arc=pass header.oldest-pass=0 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 11815606A32D;
	Fri, 27 Nov 2026 10:50:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZRufHj86
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795776615;
	b=4aYNFSU4lGK3MpfXfrjcy9+JZM2BvkCwR6lylphvnBFXX7QxKKxDX+OVo0SNj03gdM9P
	 LcC5GvsAJomHTT9sMi7e7XF6zMB9Mt6G1bUkbCVHFblMxgxuRHe3oXZBeuB5Y8t1BdB1T
	 Xlem8IXq1Kx6Oo/cqPT2+lE9LAHdEOln9rsY3qokgw4i0IB3qjiGuH1O9o/7bjijsUGTo
	 Di/YMNl7pOSe8tP7KxTEF2jeaPlYE41illmughjH38tmHzsx3M21y6xKp1NhoKAuevg9X
	 xeWM0HzlfL+W80Bu349yqoue4Dd9/ZxSK2BBmXzTvcrmxHOab6SacQb62n7pCt15xBQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795776615;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Message-ID:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Date;
	bh=m1xJ2jZz3LYgTQ/9T2l2tE7BsbSdo/loePkJzVMlzsg=;
	b=M8gqBQa5Z/VU9nBLIW8vpdbJXpfkkvida5hc0SBBXIKUvxDQrFehx8pawIQDuxjrWn/g
	 ByYdyY6xvWEjCQThtsDV6wHP3krDtj42FpatAkWmd5rANh6j2dis4h89cnSjmRYoaYDc+
	 SzM5dWsL79WKWY/5znFI8fZeYKsYNVkipbunyyTqoWEdalrazUJDd7pEYYtreDwPhpr/m
	 VQyD7k6eyaUuaYD8moZWo8LneUQ5L5SpwGMS0idbXSQZVLx+6Jdxwr1L2IRhUcXo98oml
	 qsLGyqw4INQOg0nR1F2E55aFW5U7ElRlsa9Wv6BlTvj3LddmtKDjTteusLrcklXWo8A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZRufHj86;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(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 UTF8SMTPS id 2EAE0606A323;
	Fri, 27 Nov 2026 10:50:14 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id 1A7171F00898;
	Fri, 27 Nov 2026 10:50:14 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795776614;
	bh=m1xJ2jZz3LYgTQ/9T2l2tE7BsbSdo/loePkJzVMlzsg=;
	h=From:To:Cc:Subject:Date;
	b=ZRufHj862oNXCKBABV2iHBEDCjJPBsrx6ImRN4w2B7UtTUz6e6y/3Chv4D953IWMK
	 jYLWVgGOXHjUT4LCUEfsqgNah/KzIwv5RbO5M+qcVkT3hfn9TUuvDq3+BYw8Ny1tIH
	 sgCbROiy8h8sVje5i0OrTcI+xPAO+VVON149jrrLSnKzOEXD+hr6YGhevtL613dfXP
	 xBDCN1bUgQWnutsnbmE4ClZxT8iDjTxIgrjEGO8inGPtl4g6j9I22nG2FI/ijduiWP
	 zAEESElwD5T9FR6bDO2i0u3DQhsVg57HttAfu4TCmmDsSYxTtBXfYorH4ap7UaKbWs
	 p1BPzEWug+qyw==
X-Cc: horms@kernel.org, phil@nwl.cc, syzbot@lists.linux.dev
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