From: Paul Chaignon <paul.chaignon@gmail.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Ahern <dsahern@kernel.org>,
Tom Herbert <tom@herbertland.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>
Subject: [PATCH net v3 0/2] net: Fix inet_proto_csum_replace_by_diff for IPv6
Date: Thu, 29 May 2025 12:27:40 +0200 [thread overview]
Message-ID: <cover.1748509484.git.paul.chaignon@gmail.com> (raw)
This patchset fixes a bug that causes skb->csum to hold an incorrect
value when calling inet_proto_csum_replace_by_diff for an IPv6 packet
in CHECKSUM_COMPLETE state. This bug affects BPF helper
bpf_l4_csum_replace and IPv6 ILA in adj-transport mode.
In those cases, inet_proto_csum_replace_by_diff updates the L4 checksum
field after an IPv6 address change. These two changes cancel each other
in terms of checksum, so skb->csum shouldn't be updated.
Changes in v3:
- Rebase.
- Use proper tag for reference, per Paolo's suggestion.
Changes in v2:
- For BPF, pass the new flag is_ipv6 to
inet_proto_csum_replace_by_diff directly instead of calling
inet_proto_csum_replace16.
- Document the new BPF helper flag.
- Fix the usage of inet_proto_csum_replace_by_diff in ILA in a
separate patch.
- Rebase on net tree.
- Link: https://lore.kernel.org/bpf/aCz84JU60wd8etiT@mail.gmail.com/
Paul Chaignon (2):
net: Fix checksum update for ILA adj-transport
bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETE
include/net/checksum.h | 2 +-
include/uapi/linux/bpf.h | 2 ++
net/core/filter.c | 5 +++--
net/core/utils.c | 4 ++--
net/ipv6/ila/ila_common.c | 6 +++---
tools/include/uapi/linux/bpf.h | 2 ++
6 files changed, 13 insertions(+), 8 deletions(-)
--
2.43.0
next reply other threads:[~2025-05-29 10:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-29 10:27 Paul Chaignon [this message]
2025-05-29 10:28 ` [PATCH net v3 1/2] net: Fix checksum update for ILA adj-transport Paul Chaignon
2025-05-29 10:28 ` [PATCH net v3 2/2] bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETE Paul Chaignon
2025-05-31 5:10 ` [PATCH net v3 0/2] net: Fix inet_proto_csum_replace_by_diff for IPv6 patchwork-bot+netdevbpf
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.1748509484.git.paul.chaignon@gmail.com \
--to=paul.chaignon@gmail.com \
--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=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tom@herbertland.com \
/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;
as well as URLs for NNTP newsgroup(s).