From: Julius Bairaktaris <julius@bairaktaris.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, dsahern@kernel.org,
idosch@nvidia.com, richardbgobert@gmail.com, willemb@google.com,
ecree.xilinx@gmail.com, daniel@iogearbox.net,
john.fastabend@gmail.com, sdf@fomichev.me, martin.lau@linux.dev,
ast@kernel.org, andrii@kernel.org, eddyz87@gmail.com,
memxor@gmail.com, song@kernel.org, yonghong.song@linux.dev,
jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev,
shuah@kernel.org, bpf@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net 0/2] net: keep the TCP fixed-ID flags on the header they describe
Date: Sun, 1 Nov 2026 17:46:02 +0100 [thread overview]
Message-ID: <cover.1792857378.git.julius@bairaktaris.de> (raw)
GRO sets SKB_GSO_TCP_FIXEDID for the outer IPv4 header of a TCP packet
whose IDs do not change, and SKB_GSO_TCP_FIXEDID_INNER for the inner
header of an encapsulated one, since commit 3271f19bf7b9 ("net: gso:
restore ids of outer ip headers correctly"). Encapsulation,
decapsulation and the GRE and UDP tunnel segmentation paths do not keep
the flags on the header they describe, so a TCP stream that GRO merged
and that crosses a tunnel boundary is segmented with the fixed-ID state
of the wrong header. Sashiko found this in review of an ipmr series:
https://lore.kernel.org/netdev/cover.1792293419.git.julius@bairaktaris.de/
Patch 1 moves the flag on encapsulation and decapsulation and keeps the
encapsulation level below GRE and UDP tunnels. The three changes are one
patch because each alone loses fixed IDs in a case that works today.
Patch 2 adds a selftest.
Tested in QEMU (KASAN) with the selftest, 17 cases, 400 segments each:
- net (7076f684d513): 5 cases fail: fixed inner IDs incremented after
IPIP over IPv4 and IPv6 (40 distinct inner IDs), outer IDs repeated
after GRE and VXLAN over IPv4 (10 distinct outer IDs for 400
segments), and a VXLAN stream with fixed outer IDs whose outer state
survives decapsulation into IPIP. The same 5 failed in 3 runs of an
earlier version of the test.
- this series: 17 of 17 pass, 3 of 3 runs.
- with only the decapsulation part, or only the encapsulation and
segmentation parts: 8 and 5 cases fail, among them every
encapsulation followed by decapsulation without segmentation, which
passes on net.
- fou_gre_gro.sh and bareudp.sh pass on net and with the series;
gre_gso.sh and udpgro_fwd.sh (3 paired runs) show the same failures
on both, which come from the slow emulated machine.
I used Claude (Anthropic) to help write these patches.
Julius Bairaktaris (2):
net: keep the TCP fixed-ID flags on the header they describe
selftests: net: check TCP IP IDs across tunnels after GRO and GSO
include/linux/skbuff.h | 30 ++
include/net/ip_tunnels.h | 2 +
net/core/filter.c | 11 +-
net/core/lwt_bpf.c | 1 +
net/ipv4/gre_offload.c | 1 -
net/ipv4/ip_tunnel_core.c | 5 +-
net/ipv4/udp_offload.c | 1 -
net/ipv6/exthdrs.c | 11 +-
tools/testing/selftests/net/.gitignore | 1 +
tools/testing/selftests/net/Makefile | 2 +
tools/testing/selftests/net/tcp_fixedid.c | 396 +++++++++++++++++++++
tools/testing/selftests/net/tcp_fixedid.sh | 291 +++++++++++++++
12 files changed, 744 insertions(+), 8 deletions(-)
create mode 100644 tools/testing/selftests/net/tcp_fixedid.c
create mode 100755 tools/testing/selftests/net/tcp_fixedid.sh
base-commit: cb284914e749388eef402938bdb3115fe1f6d337
--
2.53.0
next reply other threads:[~2026-11-01 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 16:46 Julius Bairaktaris [this message]
2026-11-01 16:46 ` [PATCH net 1/2] net: keep the TCP fixed-ID flags on the header they describe Julius Bairaktaris
2026-11-01 17:30 ` Alexei Starovoitov
2026-11-01 16:46 ` [PATCH net 2/2] selftests: net: check TCP IP IDs across tunnels after GRO and GSO Julius Bairaktaris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1792857378.git.julius@bairaktaris.de \
--to=julius@bairaktaris.de \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=ecree.xilinx@gmail.com \
--cc=eddyz87@gmail.com \
--cc=edumazet@kernel.org \
--cc=emil@etsalapatis.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardbgobert@gmail.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=willemb@google.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox