From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 678564F55B6; Wed, 30 Sep 2026 16:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790787019; cv=none; b=SRISHaH6lJ48MeZq8IxqeLF4GrpiLcmgzVSdohCAyO+bfHChR6DSWEME9UN/7Svl80YNQAJ55KGandMbtU1wnT+qqMhIxGBstxGV27QSdDF9s/WgWTO1XVVub28ZlxKuXSNTx/AhGBBRw7zYkzO148eF/Ggmexlgi8HosjDKsrg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790787019; c=relaxed/simple; bh=u/SMlNayOj3GaXQ+A5cYyBfbBOhCcfm3EPnUeSX/SKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t5rp72npVEQ0kwUNKg0qblr4uAnc4R3y4GKMzQ0U+goq17u+Gwyrd6B1UTYdfoGgDx4zkodVvKJFAJznq5n0uztaNQeUaTz+6msron7EeKnWzG0VQECRXtSoaG8XUqs/5wSKEXsxZLRMjboo6qt0fiSNXBmHIVCqjsc++wLSrxM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zTIrUNiw; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zTIrUNiw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C513E1F000FF; Wed, 30 Sep 2026 16:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790787018; bh=rcM4r+MZJyXMazv3ojoOWjbR5k5UBCwM9DQWQ3RFM4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=zTIrUNiwTCY65nqhf7RJ2g6gI2MxJqOEzfiCjGhU+cTSPaAFNYNvhYtCBaMn6Wxzq CwUYnptPsC33DzpFMQFnPrpG9K2pc9ZGLMXeJ8/Wuw8SnOu/gWpiFCbjy5c37kXCXD 7iKpg6mKJJ0bGNbgXKy42lhnufTUkysmiDqNvAk0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Karl Mehltretter , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 7.2 083/457] netfilter: nft_synproxy: use the family-aware checksum helper Date: Wed, 30 Sep 2026 17:23:08 +0200 Message-ID: <20260930152347.841506063@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152346.024115587@linuxfoundation.org> References: <20260930152346.024115587@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Karl Mehltretter [ Upstream commit a311a898172743558b82f6035ef2aa8c310a4223 ] nft_synproxy_do_eval() verifies the TCP checksum before it switches on skb->protocol. It uses nf_ip_checksum(), which constructs an IPv4 pseudo header and relies on the IPv4 header checksum when folding the whole skb. Neither operation is valid for an IPv6 packet. A correctly checksummed IPv6 segment can therefore fail verification when it reaches the hook as CHECKSUM_NONE or, at NF_INET_LOCAL_IN, CHECKSUM_COMPLETE. nft_synproxy_do_eval() returns NF_DROP before nft_synproxy_eval_v6() can send a SYN-ACK. nft_synproxy_validate() deliberately admits NFPROTO_IPV6 and NFPROTO_INET, and the xtables counterpart ip6t_SYNPROXY.c already calls nf_ip6_checksum(). Use nf_checksum() with nft_pf() so the checksum helper dispatches to the packet family's implementation. Fixes: ad49d86e07a4 ("netfilter: nf_tables: Add synproxy support") Assisted-by: LLM Signed-off-by: Karl Mehltretter Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nft_synproxy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netfilter/nft_synproxy.c b/net/netfilter/nft_synproxy.c index 9ed288c9d1688..554a96a000f40 100644 --- a/net/netfilter/nft_synproxy.c +++ b/net/netfilter/nft_synproxy.c @@ -118,7 +118,8 @@ static void nft_synproxy_do_eval(const struct nft_synproxy *priv, return; } - if (nf_ip_checksum(skb, nft_hook(pkt), thoff, IPPROTO_TCP)) { + if (nf_checksum(skb, nft_hook(pkt), thoff, IPPROTO_TCP, + nft_pf(pkt))) { regs->verdict.code = NF_DROP; return; } -- 2.53.0