Skip to content

net: Fix inet_proto_csum_replace_by_diff for IPv6

Paul Chaignon bpf netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesApplied 2/2
  2. v22 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Rebase.
- Use proper tag for reference, per Paolo's suggestion.

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net: Fix checksum update for ILA adj-transportinclude/net/checksum.h net/core/filter.c net/core/utils.c +1 more+7 -70 repliesApplied
2/2bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETEinclude/uapi/linux/bpf.h net/core/filter.c tools/include/uapi/linux/bpf.h+7 -20 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDaniel Borkmann
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net v3 0/2] net: Fix inet_proto_csum_replace_by_diff for IPv6

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/[email protected]/

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(-)
Signature · 1 line
2.43.0