🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23989

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

#23989
From: Pablo Neira Ayuso
Date: Sat, 28 Nov 2026 22:01
61 lines
11459 bytes
On Fri, Nov 27, 2026 at 10:50:14AM +0000, syzbot wrote:
> 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.

This patch is a duplicate, there is a patch to address this in the ML.

> 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: <awtPMiZD8FDDwuC1@chamomile>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373284-linux-kernel-netdev=dewy.ru
References: <4feea54c-bd91-4ff1-aae5-9ba4bb835449@mail.kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373284-linux-kernel-netdev=dewy.ru
From: pablo@netfilter.org (Pablo Neira Ayuso)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] netfilter: nft_synproxy: only handle a plain SYN or a
 plain ACK
Date: Sat, 28 Nov 2026 23:01:22 +0100
Organization: Usenet Network
Message-ID: <awtPMiZD8FDDwuC1@chamomile>
References: <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="1040743"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HOHWVgXUr3/U0E7E34cdL8Anlj8= sha256:pidnVvHyLGaIApduxyjA4/a/fgj9nt3oqfxVNk3fSMI=
	sha1://sgRR2ke4KwL+sIghME81DWLBk= sha256:oPJn+HxwAW3bDHbOjYgc4X247Hu7xErbLRoQA8PWkkg=
Content-Disposition: inline
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 D1A5B125F8A; Sun, 29 Nov 2026 01:02:02 +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 ufLRaCKlOn_d;
	Sun, 29 Nov 2026 01:01:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-373284-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 29212125F8C; Sun, 29 Nov 2026 01:01:43 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 92F3123BB5; Sat, 28 Nov 2026 22:01:39 +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=1795903296;
	b=Wb8EMUnEKlnOrhfmftN6mw5pQOyxiIZIjl9OXv50zhivjMtGXRshas4ywP0Srh+N/57v
	 X1O4pfUfy+Z7pSsYUIUYoDweGtkxp8t8OHB2ksiqCFbohAx/O25U7HGlg7zc6XV/6CRfZ
	 jSBzJRgrYXY/YZJVfgI3O1d9YRBoef3meQrDHvNGPzgLHtkJsmI24KIrtcJIbfPOg3kyM
	 LdEdLfp7KFEhwR0Ezxseq4vsSp5vMhz8u4g7/L+dYClLuxQQApZ16lBdDEiQ0A5MD2M88
	 Mtg8+X1B2MjbIyHWV2CLk7uv0sU6l8KE/6MNA8hG3nk6oDjBgcY2pB/p6AbyZBkWshg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795903296;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=wX6tqAErPM4RaIjTMPbqE+6F2jXHq+6feDiEc1vIdNA=;
	b=GgzSxNk70i0fSJ+ANPv+X0/pSZZ/aaZqmOu4sQe2GjWhfeXIgZRRLQbVbNYDzs4RgeRR
	 pWIgDJb7cQ/CBF4t/a9/rzfUXzmbB6wt9JOBpZ/1QPT6xNaaLQjPmt45gdfAvaEndNVH1
	 DeBHL2U3WlLJssggjAlyXLeitk5GxJDalqPuHIMRfTNkYSRnCtUx/cWftreFrgwKoEvH9
	 NEV1qdErlnuqTfySTE3It4/+D/et2M+wY/D1OIy26j6dlMPyzvgMfsOHdPkuA2KGd8di9
	 EJiWZJDvMU9MLG15PyE0ySMga/7KUTRP3GP8QyniPpOc8GmiYYQJ8blNpL/Hlmn3XnA==
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="hteQ/DVV";
	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 07D34606A32D;
	Sat, 28 Nov 2026 22:01:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=hteQ/DVV
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=1795903295;
	b=Jkm7So1/YUAdEgHwm57dB7uzMUOhEmanYZhx2udlUZhBJ5IxGnPUpGgSeyr66IzehoQa
	 HA4nFT+gsBWKajk+FnGlWmIa3uobVTod99mqLc8+xlaNiIi/puzym3ErYAjhirPQsb4Lz
	 k6H3b5mQ8l05hH+NarVJ3a2udwP4g0h5phXSGQsMgvO09yDld5kTu4XHUWvlb13rlWG/c
	 VV7OiSA02eK2zQw4RKjsqIFvXfzBHu/VhqCr/la/9RW+lUwBGFn5S8Y0m18aKZrSi9c2l
	 xYzxbWSEObmMUTYzwqoNwA6iC6S+Dso3+CEMafyryAfOr4BMmQcCkcVwLU/KdLuziAw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795903295;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To:X-Spam-Status:
	 X-Spam-Checker-Version;
	bh=wX6tqAErPM4RaIjTMPbqE+6F2jXHq+6feDiEc1vIdNA=;
	b=JgOzzdmlbv53hmZoFC2/R7oIslRGlZGSZikfJ7IyKeR0/HEQKOEvIhAC39mER16kCJMi
	 uAA+kgA3jLI7+Qu+KO65c+fNQ/sHFQk8s5us0bVzv0aUpjxCIVz/aKVmqOE793hhlU9Qv
	 szfXDXxQSJCetQUHfQM6PtjIL46Xjy7YO47fK2dgs89twrzfgehAJqqAGn1n0YUmZA8xF
	 kZQWpLdcQC0BlG5DEsszCe6Bf2HFbrhSi8ACMUU+x9I3VNlFnieyqZ+8Jgs34VPMRDZ5E
	 h7GV5vxZa/ZwQCt1CaAy+eMiz7gnRvugdEBfcs+KO7lGydeda94KrD8C06lVyNgQ+ag==
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="hteQ/DVV";
	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) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id 434F4606A31C;
	Sat, 28 Nov 2026 22:01:33 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 434F4606A31C
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=1795903285;
	bh=wX6tqAErPM4RaIjTMPbqE+6F2jXHq+6feDiEc1vIdNA=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=hteQ/DVVe0TQvXwTkEfkCuENdYpEvqqd8b6POGeMgiXYGK6DN0f1nl489QojoZJks
	 9afsa0oxMej7apaYStc3Qf+w+xqS671AG6/HC6fHnpoP1QW/pA4ma0FZM6VxZ9tYup
	 +H2IULKSMDI85JxAAzrQ045PrN2CRPbhr/7AWMGH1o4OgpMDID61OrE2V1XytqJQOx
	 KXZvyiuHPN1RyxOaEag083C2s80TPKex6haaUI9oTSFEsh61U20hs4a++ICkiyvi/T
	 uWCemptoECYG360kfi3jXX4LNwLfaSS6Am2DyQ7f6afCDcK7PoDxFHM7mtfz2e2dVI
	 zEf5WKIsM5AyA==
X-Received: from netfilter.org (mail-agni [217.70.190.124])
	by mail.netfilter.org (Postfix) with UTF8SMTPSA id 4CEC36007E;
	Sat, 28 Nov 2026 23:01:25 +0100 (CET)
X-Cc: syzkaller-bugs@googlegroups.com,
	Krystian Kaniewski <krystianmkaniewski@gmail.com>,
	coreteam@netfilter.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>, Florian Westphal <fw@strlen.de>,
	Jakub Kicinski <kuba@kernel.org>, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Fernando Fernandez Mancera <ffmancera@riseup.net>, 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
X-In-Reply-To: <4feea54c-bd91-4ff1-aae5-9ba4bb835449@mail.kernel.org>