From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796041046; b=4g3r866NxZbDVAvpQ7M/WaQwagRJBIzngp3jyr0uib0qcCE6P5L09QmeBIpYQVqSyao1 NacSc2ZOHRcA/2nSZR78ZBIFADvEQpHnClhJZn2PjDHYA8GOxmAi1xXMphmwiz1jQW/nn CD8kV3TdcqTnLDKxMnfxFAG3WEFDEP30yDMdqbDYCL9EXzBIKozaSlWyRqtf0EdLWmtBZ ZuNQBff3k6uLgZMytYzObttCwB/2B/ajqrjlLyVSL3zGm+hFse/xubii9cOBVbO8YT43J zI/ci4FuywchuaediQjByB7ZwFDI3Egygz7KOOZl4xLn2RZcrUwi7HntbL0Pf9e9spw== 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=P+Qyc3rcXzJHK/soSRuQ3cI1Hgxfbae+KxIoMfdsYpoL3gIofBNV+3IIib/jxf2nyHss Un0clGh2td34ta3vePPk3RS83VL8jRl60SP/g1EP2pzNTc1+WfsqyilMq+NF/fEddz/A8 c6aeRewExlPYsqpgLLmJgO5FZe/7Hcgb9GztIizuMKYBsnsnLE0e6wU5vRCvI9CcktfhM piNLJX9sUK7g08HsMv1B+/PmOHmTINmim+1InjZbFcINPpdjnFhePNF1VCKyhmJDAzRNF BtHrB2SaQ498iWAbnaUgawOBRZFDdeqsm5YzZ6d5/BM1LbQAuc6exc6I7nyK1RC3XDg== 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=h+de7oUo; arc=none smtp.remote-ip=209.85.218.41 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 B2A96606A31C for ; Mon, 30 Nov 2026 12:17:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B2A96606A31C 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=h+de7oUo Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-c51a14bd405so679420266b.2 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=lists.linux.dev; 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=h+de7oUoGY4AMQaY2YYyIbWAJwaLGCCZ4jTCocPQVxT2lXB2uqk/IENSIoBBCf1c+x ntOV7LWmtuKUSRu01wDJyh1/63DKn1Wsr+6HCFHD+QhwVIZdUdYCaez+1diGcUpMrt6h K3Ow0J26eGT/izzkZya2t6ULfmT3P5en8a+e1Uajej4HnYKcUhVSNqQK8AYFNXV0NqR0 mRBoKr/DBjxwt4xMf3neYAzVMGxmphf/4ww7KIrfcQwzXn4Zo7wJq8AZ/LMAlCwN8Y6c sTMYxPBGShf7vgCApUWyXcKRBCMoNGBQR9yJT/ouMbtrAiDszr+/jy1mYoxLOleQEV91 uFHA== 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=pkn20BqKYUNqbly87Xmhqj2Aja/REcMp/RRMRs93ud2OXRMulK5d0g7GlXg4bB8v/4 Vv5QGbWCSFBvYi8cI3iV6jo3PohexV2yXf8zpXfIyGiK8dbGujSzprM+Wl+nZOvm2H/J un4g/avoMM6u0jn1zFHkXpqUHqY//i+RQLOpLSk1Z+RuhRgEGkDClshgL1CVkAKEwj5b WS1+3SQaku0r4k8Y+mQlzMuz5EOX1Q78VEicov1S1KhN7CiaUh5PjzYI83qQdO2Ji2Eb FXWxHkj60ttKDQSeB6cQOHoD9yz852l/pi6WRoO47JrGAp28vA7H9iKZqffZruVJFK61 IrHQ== X-Forwarded-Encrypted: i=1; AL+hErGPKOQ7ptLjwZFqXegn8nsIUXUbpV+hPnaE5Q5whOtyvWip6bSGsjojUJWlhxT7JpwqakFH0D8=@lists.linux.dev X-Gm-Message-State: APuU4Z9yWT3gYYYwKXbBTCH5I6vzwYd2SAlgwNA6kJadcPi4dYzytT1V 3wGxsMUS58PzYvJgAbWRfrKZ37+nzWOp2gGcjV41daziRTD7CaV2EzlD X-Gm-Gg: AZFdTZdQCctUsOslqp2iztsF03SPgbMCktBItrwBTGEOlWEzNbWYEVuKxf1KXiA6pk+ Ls7cTVJSEw2Otuy3A9vbkAUwWrX4C6WBpvc1YVTyvQBrvsFxXyG/OkT8c+v1fPsUmYcmm8w845v gm/xCsBFNP2V2c+Q/e3U53n++WO4kfpIi9R63NGqMpwA+IE3wlggYhbCcnFDjjcqTrEzs1xTF7O KgNTm5bCUdwkri9OxD2jTx1G2ypWuZXxiCRhV7azIY/D5bGBwl1I74vrrvWHsGLOxllxSaHf5As 3EvkwMWfoJQHx7PCIa3I8VfraWPDva9eRDtSz3I6AhtO0cMCS7UbCz696EwfLQRHB4DvBJLtPRX df0J7S6dJVUrsFI1xFS2mV4J1ZAmt5w7N4pgPuhFcTVelsOAMQqmt+Hg1RmFJARZRmklnd33XLH iU21wnb63koIL9c2kCiMX2eoEug5mUVdqJC1TL8FvRpoTtXPRSnVje5+tyfJCiC5wJHMWn/2f9a XEtWg25lqzEI/wFbfZM0t6aW7EzlCSCoc9E0NduVqnVE1AAYKq/xxAD765QxaFUJgq9ZVz66r6B ZWZiM2HLmfqXWJlajRkmzK7toyMe8kf1uqvdqPCvTX28uALL2uZCF60LT3qw+3Gs0swZtEx5cFn W9r1EISnPjiSqfznVoQjvT5HzURikvEUVprd7ny3uNYtZqu/3W8lYVuf0ckTGPdZnlkR8EWFZ7I oeKc3kohZXz8qb0wXql96rTbPAFZH+F2gNsv/oE2F7OH0NdstJlDWGBQxWzJaROrI= 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: syzbot@lists.linux.dev 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