Skip to content

Fix csum unnecessary on bpf_skb_adjust_room

Daniel Borkmann bpf netdev 1 version Applied

Status from this message: Applied. Thanks

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 8 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3bpf: Fix up bpf_skb_adjust_room helper's skb csum settinginclude/linux/skbuff.h include/uapi/linux/bpf.h net/core/filter.c +1 more+30 -20 replies
2/3bpf: Add csum_level helper for fixing up csum levelsinclude/uapi/linux/bpf.h net/core/filter.c tools/include/uapi/linux/bpf.h+122 -24 replies
3/3bpf, selftests: Adapt cls_redirect to call csum_level helpertools/testing/selftests/bpf/progs/test_cls_redirect.c+6 -32 replies

Reviews trailers per patch

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

PatchAlan MaguireLorenz Bauer
1/3R-b
2/3R-b A-b
3/3R-b

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

Read the v1 thread

Cover letter [PATCH bpf 0/3] Fix csum unnecessary on bpf_skb_adjust_room

This series fixes an issue originally reported by Lorenz Bauer where using the bpf_skb_adjust_room() helper hid a checksum bug since it wasn't adjusting CHECKSUM_UNNECESSARY's skb->csum_level after decap. The fix is two-fold:
i) We do a safe reset in bpf_skb_adjust_room() to CHECKSUM_NONE with an opt- out flag BPF_F_ADJ_ROOM_NO_CSUM_RESET.
ii) We add a new bpf_csum_level() for the latter in order to allow users to

    manually inc/dec the skb->csum_level when needed.

The series is rebased against latest bpf-next tree. It can be applied there, or to bpf after the merge win sync from net-next.

Thanks!

Daniel Borkmann (3):
bpf: Fix up bpf_skb_adjust_room helper's skb csum setting
bpf: add csum_level helper for fixing up csum levels bpf, selftests: adapt cls_redirect to call csum_level helper

 include/linux/skbuff.h                        |  8 +++
 include/uapi/linux/bpf.h                      | 51 ++++++++++++++++++-
 net/core/filter.c                             | 46 ++++++++++++++++-
 tools/include/uapi/linux/bpf.h                | 51 ++++++++++++++++++-
 .../selftests/bpf/progs/test_cls_redirect.c   |  9 ++--
 5 files changed, 158 insertions(+), 7 deletions(-)
Signature · 1 line
2.21.0