Article View: linux.kernel.netdev
Article #17483Re: [BUG] netfilter: synproxy: server ACK carries TSecr shifted twice, rejected by tcp_check_req() since v6.15
From: Florian Westphal
Date: Mon, 16 Nov 2026 22:37
Date: Mon, 16 Nov 2026 22:37
73 lines
9508 bytes
9508 bytes
info@openservis.cz <info@openservis.cz> wrote:
> Possible fix (untested): build the server ACK with TSecr =
> synproxy->its, so that synproxy_tstamp_adjust() brings it to the
> backend's TSval, or keep the generated ACK out of the adjustment.
>
> We can run a patch through the same lab if that helps.
Please try this patch:
netfilter: synproxy: fix double tsoff application in server ACK TSecr
diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
--- a/net/netfilter/nf_synproxy_core.c
+++ b/net/netfilter/nf_synproxy_core.c
@@ -651,6 +651,7 @@ ipv4_synproxy_hook(void *priv, struct sk_buff *skb,
const struct ip_ct_tcp *state;
struct tcphdr *th, _th;
unsigned int thoff;
+ u32 tsval, tsecr;
ct = nf_ct_get(skb, &ctinfo);
if (!ct)
@@ -732,13 +733,18 @@ ipv4_synproxy_hook(void *priv, struct sk_buff *skb,
NF_SYNPROXY_OPT_WSCALE |
NF_SYNPROXY_OPT_SACK_PERM);
- swap(opts.tsval, opts.tsecr);
+ tsval = opts.tsval;
+ tsecr = opts.tsecr;
+
+ opts.tsval = tsecr;
+ opts.tsecr = tsval - synproxy->tsoff;
synproxy_send_server_ack(net, state, skb, th, &opts);
nf_ct_seqadj_init(ct, ctinfo, synproxy->isn - ntohl(th->seq));
nf_conntrack_event_cache(IPCT_SEQADJ, ct);
- swap(opts.tsval, opts.tsecr);
+ opts.tsecr = tsecr;
+ opts.tsval = tsval;
synproxy_send_client_ack(net, skb, th, &opts);
consume_skb(skb);
@@ -1074,6 +1080,7 @@ ipv6_synproxy_hook(void *priv, struct sk_buff *skb,
struct synproxy_options opts = {};
const struct ip_ct_tcp *state;
struct tcphdr *th, _th;
+ u32 tsval, tsecr;
__be16 frag_off;
u8 nexthdr;
int thoff;
@@ -1162,13 +1169,18 @@ ipv6_synproxy_hook(void *priv, struct sk_buff *skb,
NF_SYNPROXY_OPT_WSCALE |
NF_SYNPROXY_OPT_SACK_PERM);
- swap(opts.tsval, opts.tsecr);
+ tsval = opts.tsval;
+ tsecr = opts.tsecr;
+
+ opts.tsval = tsecr;
+ opts.tsecr = tsval - synproxy->tsoff;
synproxy_send_server_ack_ipv6(net, state, skb, th, &opts);
nf_ct_seqadj_init(ct, ctinfo, synproxy->isn - ntohl(th->seq));
nf_conntrack_event_cache(IPCT_SEQADJ, ct);
- swap(opts.tsval, opts.tsecr);
+ opts.tsecr = tsecr;
+ opts.tsval = tsval;
synproxy_send_client_ack_ipv6(net, skb, th, &opts);
consume_skb(skb);
Technical Details
Message-ID:
<avuFkgYTcgaVISkg@strlen.de>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364772-linux-kernel-netdev=dewy.ruReferences:
<CAFvzkdAXBNAWcHFNo6akAo63Wd8B_jvhkt=AEmuLR9fgPBEfGg@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364772-linux-kernel-netdev=dewy.ru From: fw@strlen.de (Florian Westphal) Newsgroups: linux.kernel.netdev Subject: Re: [BUG] netfilter: synproxy: server ACK carries TSecr shifted twice, rejected by tcp_check_req() since v6.15 Date: Mon, 16 Nov 2026 23:37:06 +0100 Organization: Usenet Network Message-ID: <avuFkgYTcgaVISkg@strlen.de> References: <CAFvzkdAXBNAWcHFNo6akAo63Wd8B_jvhkt=AEmuLR9fgPBEfGg@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2183447"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:QGhpsJW7KR/SB0UhFn9Ox1qF4Ro= sha256:8M0RaHh4m389Z/b5ZaUENhcYWg0dqB2mIOihWwl7xLc= sha1:4gTO6UmC1gdDg6+3Q+9MXffpSW8= sha256:MOHaXa557w/baYGUKIXLD8c/iAQdO0Pld8G+JMhn5wA= Content-Disposition: inline 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 0B922114D93; Tue, 17 Nov 2026 01:37:28 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.951 X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=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-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 DjZ8uJMidKfv; Tue, 17 Nov 2026 01:37:24 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-364772-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=strlen.de X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 6F465114D81; Tue, 17 Nov 2026 01:37:21 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 074FD2A943; Mon, 16 Nov 2026 22:37:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794868638; b=ZHxybcElja/2bDUFVjAI3MrT0ILjkTZBimK8Y3eGvPTwgk+B5mcvP1b6b4kHVU0yHiir X+T5pZZtBYxZ7PaXAc6xBH9oFip94KXzGO/EA5cfoYROCy+n5OQ5JZTArJqbhShgKlD+v CxHTLUw1k5gV76QJ65MHNzFLgX+TLwCV+tTnRiG+utaDyK6eqDnys1Fybto5oU36ScNqX gdLrtItemfKiEN+2aT53jrZz8nK7TdXwR0DoUE0WWTnEfa0T+ocimkmhj3763n/Jpqvm4 +pZGvPkiX2NImjkX6rIPw+hb7zT3PtjkwtOX1hHMtRHD5GgUxajlLV9RtTz7E1A4atQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794868638; h=X-Original-To:Received:DMARC-Filter:Received:Date:From:To:Cc:Subject: Message-ID:References:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=MAeAMzdXTUkqBSO1yv5vxvoAR2ovXJnoOQrxhuCEL4k=; b=1eJX5QqYLDFz8lstMdrA1XdBDyblBboQbFCNoqSkaKdRqqF9zWbTn2qXbWriG5+EDRvB jECIdN5oFgoR+7aMd7yiv4oYA4UeZahE5UpFX8lsu01IBLTvhUQrc1S2Qubgrq0uLzEIG 3QLNtuJMxNaz8pkdIt5Kw4eq49o3eeU7Ep5vbuvVf0vkkBNwIgEHWB/xDJ5GL9f8+C2hL 0J/4l3MehIGwR5r4bGROqEeY15Zdpy2UrKmlH1dX2XL3fEtcyyJkhmdZ6IPYMhmf2LgZv KSdjyOyLM0neSzEDBGRVfHbFaxV1a5Ft+xGXU5CqqupFyR2A5BkF4V/zJRk/2ZosuCQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=strlen.de; spf=pass smtp.mailfrom=strlen.de; arc=pass header.oldest-pass=0 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 837B4606A334; Mon, 16 Nov 2026 22:37:18 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.216.245.30 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794868637; b=sjPGs05dndEuEFjbPqXppzjBIhC4SdF9iEp7U0T6dvYCmGk318MHlFKWLmdQoM7M8SEG yuguSK9u3/eNhbB7dl7Q7XShGR9Bq11ksUGLVkk4diFiGhtpn+WDHcW3To3kcEjKcp8TK Flo23wunlbGF6n8p1UOC0YN7ZFFEOXRFmYWyPmtmyFhtlfN8hAqr5nhun0NeD9USd88/e vYeYk1Es5XRoE6RjrzhLTYq8H7jVsLzmKleuPyets8BS49Iac7q5IHaV+4R69FfANbnHo ylz5SsG1KjtBR0cvrOOjyubr+w0ZbYiHhD7/cdu6uYB6qFR8Z72ihEVB3rV1AadFaNw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794868637; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=MAeAMzdXTUkqBSO1yv5vxvoAR2ovXJnoOQrxhuCEL4k=; b=hwzL84W3JaFQK7YhL0grUYo7oGFvNeL6qNLzZg9WIc0DZ616G44xjz4Y4xYmLxLJb2za txg8rn7uI0c+XQOMzYCnTtl7zoVcbwlThDVobwO9h42U4fzeMSfsd0wIHGrjW1sqn0gBk Embm2L1SwFm0DBOLS/MWOaNahfUKuOKeUs1RY1ui68tMQsDSn0/FRpWEr2XfWhTh+b2/c 6YhP38OmTou8WqOyXI4h5k+ZqMixJrBVRs0Ms7rKIoo02aTKYINrNUEIa2GcGYngJ/wxC DSJDHJuWUW/0Z5+6tpI4cLXO5UoD9QXNfT6TPwi6q3XFCbTKqD+G8cFa3ROQKyTr31w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=strlen.de; spf=pass smtp.mailfrom=strlen.de; arc=none smtp.remote-ip=91.216.245.30 X-Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED4BD606A31C; Mon, 16 Nov 2026 22:37:16 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ED4BD606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=strlen.de X-Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003) id 9DE7660D56; Mon, 16 Nov 2026 23:37:14 +0100 (CET) X-Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, coreteam@netfilter.org, Pablo Neira Ayuso <pablo@netfilter.org>, Phil Sutter <phil@nwl.cc>, Eric Dumazet <edumazet@kernel.org>, Neal Cardwell <ncardwell@google.com>, Kuniyuki Iwashima <kuniyu@google.com>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.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 X-In-Reply-To: <CAFvzkdAXBNAWcHFNo6akAo63Wd8B_jvhkt=AEmuLR9fgPBEfGg@mail.gmail.com>