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 EC5983C060F; Wed, 30 Sep 2026 19:31:15 +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=1790796677; cv=none; b=Q9dtenSwQHuxTDHr/b1tyw29l+GpMiHzmix0luYN85XRnHZ6kGIwS/WUE6zXWcVYYW8ImSNsIJBYHqMb+rKmwYenVCyxxMu87Bx0Ry5498Ohq+W56V21W3FgG6crJiMDslB2tWQLwDYU8eh6B3euCPFESddwDZk67z0dw8zw5to= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790796677; c=relaxed/simple; bh=eQaAxOom0VYU0hcWEfc8x6f5BVf1/JSJGgRok6ZtDRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rZFT7Prne5veecVysVNL7rlTKJjd8PsvWAknPE3I4LQQT/ptvxO0Aal0OAICLzA8kONryfs3kLXS9qDSqU4A91JZ0ZTwdtnMDlXv9GiEXlgrn6p9elOoEQVOUnTFDf5KdhHKHJmA72fBY2sOldInTB3/2hAitGvmdjOZMjVQC7M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rl3oZIF6; 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="rl3oZIF6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 088251F000FF; Wed, 30 Sep 2026 19:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790796675; bh=LLlUVLQHUaYZsF4zF5q0Gd9ahgOgQotvKazfb90BuC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rl3oZIF67wblulrTHBJ9UFnWnKodsbyu6FmJVt1hW2sztni0hYIyTu7AeAMhZzf+X Q7pdvJigln5aOmLMXVh3APReZ9C2qaNy+lj0C0UNliVL8rGjqnxW9WZUadNBTO4PHB jC2rUaATXWvcoTyXBFmR5Yh45Ljh808luBzLCcBk= 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 6.6 0995/1193] netfilter: nft_synproxy: use the family-aware checksum helper Date: Wed, 30 Sep 2026 17:27:59 +0200 Message-ID: <20260930152456.346988199@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@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 6.6-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 a80bdce38546f..a6253595a1676 100644 --- a/net/netfilter/nft_synproxy.c +++ b/net/netfilter/nft_synproxy.c @@ -117,7 +117,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