Skip to content

Various BPF fixes

Daniel Borkmann netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v13 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Reworked first patch so that env->strict_alignment is the final indicator on whether we have to deal with strict alignment rather than having CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS checks on various locations, so only checking env->strict_alignment is sufficient after that. Thanks for spotting, Dave!
- Added patch 3 and 4.
- Rest as is.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5bpf: fix incorrect pruning decision when alignment must be trackedkernel/bpf/verifier.c+10 -90 replies
2/5bpf: properly reset caller saved regs after helper call and ld_abs/indkernel/bpf/verifier.c+16 -210 replies
3/5bpf: add bpf_clone_redirect to bpf_helper_changes_pkt_datanet/core/filter.c+1 -00 replies
4/5bpf: fix wrong exposure of map_flags into fdinfo for lpmkernel/bpf/arraymap.c kernel/bpf/lpm_trie.c kernel/bpf/stackmap.c+3 -00 replies
5/5bpf: add various verifier test casesinclude/linux/filter.h tools/include/linux/filter.h tools/testing/selftests/bpf/test_verifier.c+255 -40 replies

Reviews trailers per patch

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

PatchAlexei Starovoitov
1/5A-b
2/5A-b
3/5A-b
4/5A-b
5/5A-b

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

Read the v2 thread

Cover letter [PATCH net v2 0/5] Various BPF fixes

Follow-up to fix incorrect pruning when alignment tracking is in use and to properly clear regs after call to not leave stale data behind, also a fix that adds bpf_clone_redirect to the bpf_helper_changes_pkt_data helper and exposes correct map_flags for lpm map into fdinfo. For details, please see individual patches.

Thanks!

v1 -> v2:
- Reworked first patch so that env->strict_alignment is the final indicator on whether we have to deal with strict alignment rather than having CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS checks on various locations, so only checking env->strict_alignment is sufficient after that. Thanks for spotting, Dave!
- Added patch 3 and 4.
- Rest as is.

Daniel Borkmann (5):
bpf: fix incorrect pruning decision when alignment must be tracked
bpf: properly reset caller saved regs after helper call and ld_abs/ind
bpf: add bpf_clone_redirect to bpf_helper_changes_pkt_data
bpf: fix wrong exposure of map_flags into fdinfo for lpm
bpf: add various verifier test cases

 include/linux/filter.h                      |  10 ++
 kernel/bpf/arraymap.c                       |   1 +
 kernel/bpf/lpm_trie.c                       |   1 +
 kernel/bpf/stackmap.c                       |   1 +
 kernel/bpf/verifier.c                       |  56 +++----
 net/core/filter.c                           |   1 +
 tools/include/linux/filter.h                |  10 ++
 tools/testing/selftests/bpf/test_verifier.c | 239 +++++++++++++++++++++++++++-
 8 files changed, 285 insertions(+), 34 deletions(-)
Signature · 1 line
1.9.3