Article View: linux.kernel.netdev
Article #24639Re: [PATCH] netfilter: nft_synproxy: only handle a plain SYN or a plain ACK
From: Pablo Neira Ayuso
Date: Mon, 30 Nov 2026 13:58
Date: Mon, 30 Nov 2026 13:58
54 lines
11246 bytes
11246 bytes
On Mon, Nov 30, 2026 at 01:17:22PM +0100, Krystian Kaniewski wrote: > On 11/28/26 23:01, Pablo Neira Ayuso wrote: > > 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. > > > > Thanks, Pablo. I agree that this addresses the same bug as Nguyen's > patch: > > https://lore.kernel.org/netfilter-devel/20261005151257.9128-1-ngocthang2710.1999@gmail.com/ Actually, there is a patch before that patch which already addresses this issue by Fernando F. Mancera. > I did not notice that posting before submitting this patch. Sorry for > the duplicate. > > One difference is that this version enforces the protocol-independent > TCP flag invariant once in nft_synproxy_do_eval(), before the IPv4 and > IPv6 dispatch, instead of duplicating the same checks in both protocol > helpers. This also prevents the two paths from diverging later. > > Would you prefer to fold that form into the existing patch? Otherwise, > please disregard this submission as a duplicate. > -- > Krystian Kaniewski
Technical Details
Message-ID:
<aw2BE9rsPbQPchpX@chamomile>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374236-linux-kernel-netdev=dewy.ruReferences:
<4feea54c-bd91-4ff1-aae5-9ba4bb835449@mail.kernel.org> <awtPMiZD8FDDwuC1@chamomile> <ee5ce6cf-0cc7-4486-b555-87291a166dc2@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374236-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: Mon, 30 Nov 2026 14:58:43 +0100 Organization: Usenet Network Message-ID: <aw2BE9rsPbQPchpX@chamomile> References: <4feea54c-bd91-4ff1-aae5-9ba4bb835449@mail.kernel.org> <awtPMiZD8FDDwuC1@chamomile> <ee5ce6cf-0cc7-4486-b555-87291a166dc2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1440008"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:BmvFjJK3QFTDwmR3aBACHeXbgcM= sha256:2YaaMia/7yCZ7xnG2PawBCFwNq7GtO0otWUrC+lSq/M= sha1:qzE/STV5WaZguAo73TCB6PzmvPA= sha256:pVAZ+QOoAo3cshEV/Q4fLCTO1goSSE//d4OMkMd+SLE= 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 E592C125FF2; Mon, 30 Nov 2026 16:59:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 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] 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 9jUDyNih1FBo; Mon, 30 Nov 2026 16:59:23 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374236-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 079B3125FEE; Mon, 30 Nov 2026 16:59:13 +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 189112DC90; Mon, 30 Nov 2026 13:58:52 +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=1796047131; b=Zvma6FYCrlt8S1duhiZ2ymFVWtfrZJNkXryZnX2VNQ2T+GvQD+JB9DTLMqdBxpWHKE7v nKHoHVTSP4kCubzMZ4GMi4ZqjREV9vq/S0Jo8ZigiAOum9mJZV6/WfUKGEnL3Ib3JSy7D HMFirWILJbhw6NZAhJLCJSYPmii+bEvKQjKUU3aPb/mQwPqgEYtYq+4nyrHzF9apFKKd5 Aqi4WXOarrCtOz+spjGD0RFPRLRNgLwU+mwWxh5ZjQGknXfpAzg2fiZcbnW5EeShFdcSR Aq7zMXXNumbhhVaA+8+Qom6K/imZ5gocF/vg8822jZNBREtkb1Ls+0Rl+52r5+X85NA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796047131; 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=z8nDKs6GDVr934cQ7k9+tIXCGtTASRFIR65KbtlvWR0=; b=x0ZyRQ0OA7DSGJbHuPvvTrnAvmbeEjk7bom8v3wuu/EUmTsT28VykXxlxgZbianBkfPc w5koRf0Mwn4Ep95xt2AisoYv2tc25WeLDiv14JTbCoYy2n8u0UfcJfoR/xwCRU8BIXvO/ FRGMWTeALJPfHkEIbbKunU052fqxpGcOSrnE6GRkFuXMHzIEt1yHy/d0dA3KRnoE9xNom piksP8YSuNmt3LeOu9hBSJTSkp4PjpWRrqdKdEg9KnYebKC3vzNIITPI4/WZpqKgpDVWx 5n94cyKBbtROt951YYHM8jbA2c4+idoGw0PFYaH5b4+qgzw/0Oxhwwk5ZSsVW/Z+47Q== 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=jaLv8eya; 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 E42A1606A335; Mon, 30 Nov 2026 13:58:50 +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=jaLv8eya 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=1796047130; b=0vzstw0eN8XejKjwAb1NgoPWk8gEl25NB/L4f2jlxL+Wba2vYSK7mtTZRtzZD4rENeIO RW5BsC+v5KOqJU9dqvRWIEbOfhBhfKFycEIgM7wBui5sXAd5RFiCkWKbBdlNMdJXLWw9i LCfbWIi8BHdzMLBo4vEBSG2I+9p0+Ri6XAedOF5nGeJva6FKKK+IvU4caLpr3Xh3ussOy dyYVGCXwbyp3eiWvntcP0E167daeglL9XHEDZ7RU93ChdavMKGqAyPsmCEjiQ1yINuT94 4+sSYarTHyCsAYYSokEZHeoHMGUR2UD85e95Md7FbZQucWEGvkL1waD1NBqnsCnrJ0A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796047130; 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=z8nDKs6GDVr934cQ7k9+tIXCGtTASRFIR65KbtlvWR0=; b=Gd08PZNDm2smfpEWpdw1yd+qw0Anzfoee7U2VsZ6lyE92OqfJ0ojjz4d+FRWXOgxCtyI 6ZCjlX6mMHh+VDIXdtP2FzWOdDsI/YG3+4p6L5xUeotEuY7ieCX+gg+PvEUugJlAClpbO XnvStxU+AtcFj2qZe49WXFySwzEDmJV1RUDjGeTTkJOubiWKrWy32DUTgW5pZmoxjmmc4 /BdzSfjD4msVmOcUiF1Yd86fThvSg5BCbO3CvuVM5v9zCANysQns7VRTw0E+28RAAHK/B G0kZP9bh2Y3CuI53CKEzKp5Iq8ma8gHlayx6iTgzdRsJUBr1lt/j5/g/YfT4Q6bhWuA== 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=jaLv8eya; 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 33AA9606A320; Mon, 30 Nov 2026 13:58:49 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 33AA9606A320 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=1796047126; bh=z8nDKs6GDVr934cQ7k9+tIXCGtTASRFIR65KbtlvWR0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jaLv8eyaWESxbGXt/hITZyyhXeBvg5yWVoApevqUgSRXUqn/8goSQgBzEjn99Qe4X HG0oyR6c+Cbw80SCw47qBrbWiYF429FIbfSmLLRBPkt2dRzJgmV7LOBD6z0AmG0Nra 2xDwYgEASgCvWSP1VRwzWXedIqfvlOGFP3YTfV84QL5hgTJ761ZNTXZb+pNkBldPgG 40Iz0l1pPqhqRCTmBRmGN2dCzZRp3lbRKFQhXQNEXM2EAHP6c7gvY1ZT5ke+Urlzqb pTNtaG8KeqqPddmWktunbhwmyIMUovvtrBCPmxK412ZlxuUwJF4KnGQV4H6bH8XAZT b98RzHU0XdpMg== X-Received: from netfilter.org (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with UTF8SMTPSA id 1D73460076; Mon, 30 Nov 2026 14:58:46 +0100 (CET) X-Cc: syzbot <syzbot@kernel.org>, syzkaller-bugs@googlegroups.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: <ee5ce6cf-0cc7-4486-b555-87291a166dc2@gmail.com>