Article View: linux.kernel.netdev
Article #24805[PATCH net 05/10] netfilter: nft_synproxy: only handle pure SYN and ACK packets
From: Pablo Neira Ayuso
Date: Mon, 30 Nov 2026 21:51
Date: Mon, 30 Nov 2026 21:51
68 lines
10960 bytes
10960 bytes
From: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
nft_synproxy treats any segment with SYN set as a client's initial SYN
and any segment with ACK set as the client's final ACK. A SYN-ACK thus
gets answered with a fresh SYN-ACK cookie.
If that reply is routed back to the same host, e.g. to a peer address
covered by an address on lo, it re-enters the input hook, is answered
again, and never stops. Every such SYN starts its own endless loop over
the loopback backlog, so NET_RX softirq keeps the CPU busy and memory
fills with skbs and rtable entries until workqueues stall and the
machine OOMs.
Use the same flag checks as ip(6)t_SYNPROXY: SYN without ACK, FIN or
RST is an initial SYN; ACK without SYN, FIN or RST is the client ACK.
Anything else falls through to the next expression.
Fixes: ad49d86e07a4 ("netfilter: nf_tables: Add synproxy support")
Reported-by: syzbot+d7795c8487ca4e20ed88@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d7795c8487ca4e20ed88
Reported-by: syzbot+d0d2f1a65f45b319d25d@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d0d2f1a65f45b319d25d
Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nft_synproxy.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/nft_synproxy.c b/net/netfilter/nft_synproxy.c
index 554a96a000f4..ad43faf1dd1b 100644
--- a/net/netfilter/nft_synproxy.c
+++ b/net/netfilter/nft_synproxy.c
@@ -53,13 +53,13 @@ static void nft_synproxy_eval_v4(const struct nft_synproxy *priv,
struct synproxy_net *snet = synproxy_pernet(net);
struct sk_buff *skb = pkt->skb;
- if (tcp->syn) {
+ if (tcp->syn && !(tcp->ack || tcp->fin || tcp->rst)) {
/* Initial SYN from client */
nft_synproxy_tcp_options(opts, tcp, snet, &info);
synproxy_send_client_synack(net, skb, tcp, opts);
consume_skb(skb);
regs->verdict.code = NF_STOLEN;
- } else if (tcp->ack) {
+ } else if (tcp->ack && !(tcp->fin || tcp->rst || tcp->syn)) {
/* ACK from client */
if (synproxy_recv_client_ack(net, skb, tcp, opts,
ntohl(tcp->seq))) {
@@ -84,13 +84,13 @@ static void nft_synproxy_eval_v6(const struct nft_synproxy *priv,
struct synproxy_net *snet = synproxy_pernet(net);
struct sk_buff *skb = pkt->skb;
- if (tcp->syn) {
+ if (tcp->syn && !(tcp->ack || tcp->fin || tcp->rst)) {
/* Initial SYN from client */
nft_synproxy_tcp_options(opts, tcp, snet, &info);
synproxy_send_client_synack_ipv6(net, skb, tcp, opts);
consume_skb(skb);
regs->verdict.code = NF_STOLEN;
- } else if (tcp->ack) {
+ } else if (tcp->ack && !(tcp->fin || tcp->rst || tcp->syn)) {
/* ACK from client */
if (synproxy_recv_client_ack_ipv6(net, skb, tcp, opts,
ntohl(tcp->seq))) {
--
2.47.3
Technical Details
Message-ID:
<20261130215141.1009148-6-pablo@netfilter.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374481-linux-kernel-netdev=dewy.ruReferences:
<20261130215141.1009148-1-pablo@netfilter.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374481-linux-kernel-netdev=dewy.ru From: pablo@netfilter.org (Pablo Neira Ayuso) Newsgroups: linux.kernel.netdev Subject: [PATCH net 05/10] netfilter: nft_synproxy: only handle pure SYN and ACK packets Date: Mon, 30 Nov 2026 22:51:36 +0100 Organization: Usenet Network Message-ID: <20261130215141.1009148-6-pablo@netfilter.org> References: <20261130215141.1009148-1-pablo@netfilter.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1547505"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:8SEe2zHLe3jqz8uZEWgFyOeBqu0= sha256:Er/hXg7HorxeB1eJpVRVjYDAOny8aD0jgbkL/g0XeDk= sha1:aqPyIWzcSvEZiqUzv3eWHzlcAE0= sha256:t/N+Vf1hEJwhOc0erBigaaIjwibr9Y7smngCghyNqqo= 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 CAB2B126007; Tue, 1 Dec 2026 00:52:19 +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 0TK8kRsb1eI6; Tue, 1 Dec 2026 00:52:16 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-374481-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 34FFD126017; Tue, 1 Dec 2026 00:52:06 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 5B20A24AB9; Mon, 30 Nov 2026 21:52:04 +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=1796075518; b=hpSMUoVTCvM6CKGkABeHkqleCZUkGd46V9BSzW6pYwJaYSmVJF2mJBlBDwswa5C13WwG oGugDEIfxnFBZUDaFLKuGUAAUdKhO5ntCeFjn53ZURB8nbFFxL7DT9gP6kYoTrItWnXKw fY89y+mF+wl3h5zmWgqTX2S4ujxgdTvvjDbv9nmxnprEElzR1Vz3rMs2O74Z17w6jtzSG 4CwDnFMTpqmNBk70D0wX1kZXNmOU6SsQrb6quGGSL2X/SYNkogmev5kKX3FGtt8vr6kK4 uTacFk2sdMiSXzi38T0Agv8wCeuON2tr+9zU5xOkCl6LJ136jqYed2qeTSc+BTjHOwQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796075518; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=S7xkWiqqFqg9jXR+/p6MoARXsQBC0WdioQvUUUYQego=; b=Cere/SV7jSUuJRkRDc/YNUmgV4rmAXhzsK/5FddjfqlckkQ9LqP901iwuWPbOSgToAOd U9Pnr+J/JSxs2wXbQ6cfSV2mWmNCfgz77CdSSmdi/9CwTPRrStzxJZ4caC6niCyeAJ33+ T4bPZgEzITjfGedRwcOGUZf5Wxe8K/DfyRh/TIK2zUvC1xVDg//TBrcu3JgjpEUH/QWD/ ZjdtRNtKpq2wR7+J+de7WZsTCETBOYJ3zFUKllhs25g1Av5quEPfZSzMYlwJ7IH09ktQ8 k0b4o6mdxk9MRhtETR+sgetkuwhavZRFJmqqyjlpZ921p05YZ1SPxy3MHsQaAxpynYw== 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=OdzVbyDh; 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 2473D606A69B; Mon, 30 Nov 2026 21:51:58 +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=OdzVbyDh 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=1796075516; b=Uma3xAwqzxsPNB9mvfVxyWblfLGSr3E6w1+UWQObgbhkgoMJk7lWfm2hQ+fBhv1tcbqg Be5fEw+aWh8FerFc28hKf3X5dL+05gyI/gPy3hL75ZTb9OkBRTDHN4Sw0vyu1Q01+Kboe rL4Ecz4iZ1ioyUpv1iiL5jGr7Ji305+fDkHfYyWdPYbUJT0zRMkrLPo6Id76US4BWi1Yf BeLuf59jnCqSuR/m+v0LLJUB08RqGUHmSiJOhXkcFXnMZhRNEkLVQApjPo1JsPISESMtq sxVZV9rqPE7gqFlR5o24RaYKhN6y5eSiDGxchzL3XujSHt8eAdX8DUkIaCx/0qZTMdA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796075516; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Spam-Status:X-Spam-Checker-Version; bh=S7xkWiqqFqg9jXR+/p6MoARXsQBC0WdioQvUUUYQego=; b=Rx2XHdzW0bem2T4/fM9p4j92eEXCCkAO1ZoHl9rWTtApjCH1v/oAj7kWPzFroShoJ7ny 1hHsPXfV/j3kG6LVKLmx9cCJZ70qVBVEUURmO//9nu5h+I76kD12VkuGicHufNm/GnEGb oQbeHemgqoTDsLBYV7qhGI9C4OwPqzgWywFvL29DLBNRLfSmUuAqgT/rgC+IGJHuHYXYF 0vKmi9JyFO3pBaJrBnJnkkbjhQnxxqdr+JoseF2gTWh/NBB52qu/OQjpn6AmbJpI00FY3 dgOLuPE/HzmPyZhoweNqLl+zA3UWNzbrOkfiVgbLlAEm5JsxPIDgO/23EgI0BaiulGQ== 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=OdzVbyDh; 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)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83F11606A681; Mon, 30 Nov 2026 21:51:55 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 83F11606A681 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=1796075513; bh=S7xkWiqqFqg9jXR+/p6MoARXsQBC0WdioQvUUUYQego=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OdzVbyDhDpKsB15g5KonE5NQbeB+eRyyyS8MfYFI0vyQnXkUTSC/je5fw/RXGC4Of E3asTDI5EgzrsGd1bEqrvjsytRmEsHvktFvkwiijk+ynNrYghwC5uCxwfnmd4uFg0y T15FOfKvpmil6YI9WKVd49mCAPm0Uz01G6CIRUY5oIuEq/Lz+zBU2pa0V2LKrRBSxs FSk+/dgXrOUb4cdbTf2xZ+NzF6SJ5+UFez+S2y/WBwkYvmzISSxT9T5iJ4Gl8V264Q VEQ82PuwcCnmSElTS5VrVMAmi8ZVeuqCV0y4WSbJ/9c8/rIQDmfPSPc10p+LyM57uy V+xsHa4NiNgUg== X-Received: from localhost.localdomain (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with ESMTPSA id E0EE560081; Mon, 30 Nov 2026 22:51:52 +0100 (CET) X-Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg X-Mailer: git-send-email 2.47.3 X-In-Reply-To: <20261130215141.1009148-1-pablo@netfilter.org> 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