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=uMEKsbaMzTflJOofAfC54xEKW2BD/xuqoC3ah4hkK20ANwFY/M9loQqFvVckg6t3VwZw /HVuLySyRUyVi9flBWOMX74V4tcNl2EPCC6wL0pIol0zHZnr0OP0eOtoFlacQ2mAX4hsz jNPoAi/wVr/g5ZwkrW9Elgr9UCbJ5Qe58hXQht/wWAqY31Wqa/D+nRFx7ckp4/aNZCvUH seRxgCnqJPyTIvy3TrUl05TwWBHuUCJRRt9gA+JHL6e92iO2wvLcbcjgOhRmEk6ceeMdj 4HLRTOoIK90ghX3EzwPe9l9ANvre12pZWfZ7k/jd5J25Cta5sazUsyFMTPula/jlgIA== 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=aOiNosUpwl/lWP1CK9Y6d8rdoBuboOsWBRcaS5BEQiexOAm1xOxhlqbwqFpiondePJpd pXwodRwteKxZRkp/cS5zZ3zS5nONZZjR2qBnKQf3sPsJHLQt+y0ocEBjkJHceqVJ/0AV2 zLUo49kyyu64tPx4pu9j+2902B0DJB9YEAmL2Fkl636Sbi/EPOC5O/Azcqo99aBndixb8 1wM7XuMO+f+OYPxQplzdJlglpdkD9xbmRdTNIjsnQcrvSyrMnUPi0rz8T7sMD8tvcagW6 MG5Bw3c2HEm9/mjJoyWRgiPuWr/j6u76Xbo5JNVWkpc0gGYaOc5XwNHuMjCKRSDGEhg== 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.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 BCD0A606A320 for ; Mon, 30 Nov 2026 12:17:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BCD0A606A320 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-f41.google.com with SMTP id a640c23a62f3a-c4cac7a7d3cso1538040166b.3 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=ITVIWkH9bP8VbGQa7anidEgp1YmiRVTbV+audGZjYx7KrZdnMFrC7Vc9jhX5r29BdA SUnrF/iJK76KurPxA5CnGoSHj6t5oO1p/O8v7IGU/5Xvn78o23NCWaUPJz5e88q4miiF NGgYK26B7eXSK2mN9LauC5f1SeFN5qco/g8uVFMCUDzh32ssr576D/7R7EvfV2NN3HPC 0Lk7DqDEV7r8AVpT0jktsbRcuMZ9GKnYpEELZ/LPnzb/+VQULf3GBvT39YHlizwQjtWX Ev01fyb4qMmhTaPpsDKPUcuVLQnN41npK55WzuFpJs28Uegl5igOocevKsSzxLl1oxQQ n2kQ== X-Forwarded-Encrypted: i=1; AL+hErH1EkUv9dpvP4Y2znkyJEbc9w/Xe/nG8FkxtlT6LHOEgcgd0/vopJ7M1n1WiEmdlnAmL0adL1xrzxUw4o8NWUA=@vger.kernel.org X-Gm-Message-State: APuU4Z9MiiApQUPy8Gj/DF9tkDOgRtZ3AHcNdDi8x7vBxs0PUP2hNa95 QtJ51rFUEvptRCYNUewn0iznCNlUR12v3zvFPJ+JrIS3CA5/CLeJjO/+ X-Gm-Gg: AZFdTZdFr6RZnND2QpJWUhik7IAd+/nLBI8VPVGVAjSV+3GKrQ+ycQ6ReTeSWNFjEbU tpNTO2LamqWGae8Mj88QUiAAmq3YnmIavlm3sC/oCTuTlHOPyae2dVXVDWzVFbI8dEYAqbP6NZn k1zVJwr5UArh9b90W3/pbWrZhNJSN0eWs6Z+JWkWWnmZmMu3s+1oyWXh8TyMbZ/Ij+ah1K1DF4W 8TWX0lJ3z74ejyDinhF1qVypwC/cFhVCHS8PpWdKiKH7ffk0GMMhsHD1TPUpTDA6rZ9AURLkopm wK/1dt6zBgbE7diaNAAOBUVz4pmuL+Ax2UJoasYqxRDAjtaTkdFRWqUAxYNbBCt9bwb7Tdl9VRx vREBWfcp1s/+98N6spK6FqKbx5BJFxLOvgJXqVDyS/T1zno5qKOfkzQk2H4AnJXgP/nml5EivVV Ab8I7/nGmsY+VKW4mJJWkBXqtcjb45N2EYph3v1bbifv8maVQCf2QcvM440JaS3hWuIiIifjAY5 ahWOO9tCUEHPVxYkru1AveBeVMOVr7vkxbkHJ9npfblEzGfX5gzU5GilmBlLkUF0IXaVYUSkDUa ySAVAO6kkhIGrY8ulrnkcMpxudblkhC6DeC7uUVr2zPrhd+you6EWry9IXf4CkfiDyAPjS85CK+ AFEEIS/9g4ojaBSMRoMqdTWWSdnOshhOs2raDFb57Jxm1Z8TRAyzfYiEAv4mQL3h9ozxtKIlYKZ RtoJsfy+g/y5njMCmV0A4X2F9PpsQpn64HFDT3duTzlgW/aQ6R0C6sQsDiO1Y2Mlc= 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: netfilter-devel@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