]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netfilter: synproxy: adjust duplicate timestamp options
authorFernando Fernandez Mancera <fmancera@suse.de>
Tue, 26 May 2026 21:58:28 +0000 (23:58 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 5 Jun 2026 11:11:55 +0000 (13:11 +0200)
RFC 9293 does not mention anything about duplicated options and each
networking stack handles it in their own way. Currently, Linux kernel is
processing options sequentially and in case of duplicated timestamp
options, the value from the latest one overrides the others.

As SYNPROXY is modifying only the first timestamp option found, a packet
can reach the backend server and it might parse the wrong timestamp
value. Let's just continue parsing the following options and in case a
duplicated timestamp is found, adjust it too.

Fixes: 48b1de4c110a ("netfilter: add SYNPROXY core/target")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_synproxy_core.c

index f99c22f57b7e52a9ed5120ccaa7d031f869ce332..a0bcf188810d1392ee5c7d7e2041ddc076dc16a6 100644 (file)
@@ -233,7 +233,6 @@ synproxy_tstamp_adjust(struct sk_buff *skb, unsigned int protoff,
                                }
                                inet_proto_csum_replace4(&th->check, skb,
                                                         old, *ptr, false);
-                               return true;
                        }
                        optoff += op[1];
                }