From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124 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== 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== 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 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) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 33AA9606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org 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 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== 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) Date: Mon, 30 Nov 2026 14:58:43 +0100 From: Pablo Neira Ayuso To: Krystian Kaniewski Cc: syzbot , syzkaller-bugs@googlegroups.com, coreteam@netfilter.org, "David S. Miller" , Eric Dumazet , Florian Westphal , Jakub Kicinski , netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, Paolo Abeni , Fernando Fernandez Mancera , horms@kernel.org, phil@nwl.cc, syzbot@lists.linux.dev Subject: Re: [PATCH] netfilter: nft_synproxy: only handle a plain SYN or a plain ACK Message-ID: References: <4feea54c-bd91-4ff1-aae5-9ba4bb835449@mail.kernel.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 > >> > >> 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