From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796041046; b=p283P54e685iuPnfaqhxdsj/W9IUFFOgmKxNSBZ4F7VCqYin/2xGtJK54HaivrSF0jfH FPpL/mL7ZiOjLU/SchExxMx2Clogd8u7TRSACUt6iSz5ZvY07arBdspT3PcNQSN3tylhv /lrbUkZyZtWVHpsVW8NAL0Nr4TIrnFS5qElYYSq8ANm4XxVFVH10nr4zSW7rtVWGyA0G+ W7t55bF++ha9gtZZGwFI+kSltR0l0yMIy+ImpuMH2LwysXITO6m1c1aFIwEkSV0gjQZyb 0KvjRDdRr26eowBexOtaVjKx8LXSH14hT9J9TdYql3snq1gpttZgj/NorQiK0wyLaMQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796041046; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=gAnpYwf4o9pyRrzHhn5/hy+2gd0n+zlrNiX79UNDEmA=; b=3bxWQLqEo8UP/8Wst7t8MyBC22XRNjSWI6wS4lYE8HMxmHZ4j5cr7ZBCTlXN2/IEr61N IZHiYq+Nv3NmHasE+N2kdbxgoxXiqjNt3uUY/iAnvtQV/HYx2SEmfzcvMs2u5Njy8Dodj qONVi6d0aMwDedGXvQVrNbUvV31Q+L3CrGOJHIcf+oawpPOLuNZqvhezqrNKB1XH5WhJx bKrIAdw1jENdsP4wv6bIxh+2m0dvl0NwOSD2XRP3xKqT9riFDbYdrqk+cA2C2i9YyI0Yi GPDMfoO4jQpXdCz3cBf6J7hqexGDWWiCh+WKqHIHEKfm3JXLoLwpJnjHqkGOK5Sv9pQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=iqOA0ke2; arc=none smtp.remote-ip=209.85.218.42 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C981C606A325 for ; Mon, 30 Nov 2026 12:17:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C981C606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=iqOA0ke2 Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-c511c0e2826so1202540766b.0 for ; Mon, 30 Nov 2026 04:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796041044; x=1796645844; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gAnpYwf4o9pyRrzHhn5/hy+2gd0n+zlrNiX79UNDEmA=; b=iqOA0ke2E60XzwfNYQqGoLYUZGrvNjfzSYQ2uQPq/HZz3qQQcVsWdLKZJQafKZDT8n fBCkZM3p/uHuDv54nmkN9sMKnOREMWwzDpLB8g9MbWPYVrjZKqk1aCGqvBJ7bL4ES7sc dy9Xb57U2GFb4+T9IAT5D3EQySdliwlDCsmfUNVv0EXCZQ69ZI1rS26oabGj/TTfHIGn NMaA0rWenYqQTAKyZlmALFU6PS3v4QJMnx05mXi6rCeFgmsQg0z8cLgKQT70KaEyZu9W 8rW4s7SMNyguxuXZQ5OFLTQcna+odFnRT3waTJii4KtFGvN1vYH4EQmhOtuYUtP18PRH RfeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796041044; x=1796645844; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gAnpYwf4o9pyRrzHhn5/hy+2gd0n+zlrNiX79UNDEmA=; b=rcUtZUEnSsQfC/kyvs+P96c4sjvaP8qwoEcKnRv7T5hTmLvWo+DUzrrIuYrR7mFq1F uRZeYPUnus30MoFoH4TzDaV1SzoQ7FqkrcgASf6ZrAY5LWG3FjRM2nbl+WgKlRFM6Ict +2Kf8HK/KTPpDBns+1JsNw4q8ZevAy8w2vcI/UQx7cDqJ0NhuuJXO1XnXNVG9TcB5Tuc 8A2qLjzJUaWTKj6zCjBrnR4aSoqsQVionCIaf7QBYOS/GoZzigcl7bKTMPeORuBVK5rA cUbQABWBkMijL5S0j6p+5bZgpi41yF9zjOhx+2t00wf3f8+U80IIHceggARl0DuuKg/5 qOTA== X-Forwarded-Encrypted: i=1; AL+hErEVbHXnzWVc2C/zETt/dguIyLWvOtGDps4VJo7DPbqjHYJJfUqcxxAgfaTqA6La0ixn4cozGSY=@vger.kernel.org X-Gm-Message-State: APuU4Z/UrRGPUza9m3U0m7Pjb70+jNMwXVnUxMkY5BjWK2vbJi1JiIo4 I0+SnjWSGNSeISsTa63weP0MAJJFE1hce7P4PsUeg2slNT/cChDaWYUU X-Gm-Gg: AZFdTZeVbCZburMXHoseGZISXNpBUo2b50XpFQdXmmmUXZvGADy+GBtIK3TqUVOTUlv n6UV/ihE5Vv/nDPFC9URqcP3heOCCU6vMz2S4XqEW3m5sIJODmAir4YqwQZwBTz1+Q34/z4m1Ct smyquW9n653y+OyBWn2whBqOkznRAazKgAs83T+IeX4o3Ly9v99CORVHHVDYP9EPBWyIOxo5SAz EeDJs1XMoCdEORlW/1ZF8f1ppTsAhHv8ARkP54hHvQ4DYkaEJGrlK2szDcf/RHE+ONOmFPwtss+ aZqQjwkXo0QG3rYNWUPvHzh2od1HjyQ5GFTnzGjzQsF8i8oWYIXryKpGWuSBznmXkpz/sd4wvj4 TbWMaiJAi901Qxs4r6h3tif6sLvY8w9skGLj8I5zJs43XKQp2PLNRVvxp92L+nvKrZFXUExce75 IYrJXEGRdtEhEWoL5GnMBRu5brEN0lXPOup6xhB3IiY/znw+HC67YqkxbzPJgCEaasDagCi8zI+ GEqqvS7n02U7h8mTOI6xYAv+TVGeqzA940pWcWd/Sudz32o7PMJvE/JnKNdQOwAl0ii/k10Zn1/ 7Kyc6SR4KmRDxDbAQ+FzptdebQ27Pa/UeMERCWnfcKWma4V/OCJnITZ9jRFAtV2TSMzvWFxZ7W+ aqNt1cSjPkmP9Dglxlel/2Oo7oGYVdQb+CScatsZSOIttXAsQpGSQWz7UiBHKxYKSioYjrSz9hv 1WANKCS7/C0RhZXuMWaPnJm6SRsFi7zh+jWf42rMR4qZYxs7dJDVAZzQqhIZoY5MY= X-Received: by 2002:a17:906:f885:b0:c4c:fd37:bb0c with SMTP id a640c23a62f3a-c513aaea94amr1826980066b.29.1796041044030; Mon, 30 Nov 2026 04:17:24 -0800 (PST) Received: from [192.168.100.100] (87-205-15-91.static.ip.netia.com.pl. [87.205.15.91]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513ad00d2asm1189224566b.3.2026.11.30.04.17.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 04:17:23 -0800 (PST) Message-ID: Date: Mon, 30 Nov 2026 13:17:22 +0100 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] netfilter: nft_synproxy: only handle a plain SYN or a plain ACK To: Pablo Neira Ayuso , syzbot Cc: 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 References: <4feea54c-bd91-4ff1-aae5-9ba4bb835449@mail.kernel.org> Content-Language: en-US From: Krystian Kaniewski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/ 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