Skip to content

Preparatory libbpf fixes and clean ups

Andrii Nakryiko bpf 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 7 repliesApplied 4/4

Patches in v1 All 4 applied

#Subject and filesSizeRepliesApplied
1/4libbpf: fix potential NULL dereference when parsing ELFtools/lib/bpf/libbpf.c+1 -11 replyApplied
2/4libbpf: streamline bpf_attr and perf_event_attr initializationtools/lib/bpf/bpf.c tools/lib/bpf/libbpf.c tools/lib/bpf/netlink.c +1 more+138 -912 repliesApplied
3/4libbpf: clean up deprecated and legacy aliasestools/lib/bpf/bpf.c tools/lib/bpf/btf.c tools/lib/bpf/btf.h +2 more+2 -102 repliesApplied
4/4selftests/bpf: few fixes for selftests/bpf built in release modetools/testing/selftests/bpf/prog_tests/attach_probe.c tools/testing/selftests/bpf/prog_tests/bpf_cookie.c tools/testing/selftests/bpf/prog_tests/task_pt_regs.c +1 more+6 -62 repliesApplied

Reviews trailers per patch

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

PatchHao Luo
1/4A-b
2/4A-b
3/4A-b
4/4A-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-next 0/4] Preparatory libbpf fixes and clean ups

Few fixes and clean up in preparation for finalizing libbpf 1.0.

Main change is switching libbpf to initializing only relevant portions of union bpf_attr for any given BPF command. This has been on a wishlist for a while, so finally this is done. While cleaning this up, I've also cleaned up few other placed were we didn't use explicit memset() with kernel UAPI structs (perf_event_attr, bpf_map_info, bpf_prog_info, etc).

Also few fixes to test_progs that came up while testing selftests in release mode.

Andrii Nakryiko (4):
libbpf: fix potential NULL dereference when parsing ELF
libbpf: streamline bpf_attr and perf_event_attr initialization
libbpf: clean up deprecated and legacy aliases selftests/bpf: few fixes for selftests/bpf built in release mode

 tools/lib/bpf/bpf.c                           | 178 ++++++++++--------
 tools/lib/bpf/btf.c                           |   2 -
 tools/lib/bpf/btf.h                           |   1 -
 tools/lib/bpf/libbpf.c                        |  47 +++--
 tools/lib/bpf/libbpf_legacy.h                 |   2 +
 tools/lib/bpf/netlink.c                       |   3 +-
 tools/lib/bpf/skel_internal.h                 |  10 +-
 .../selftests/bpf/prog_tests/attach_probe.c   |   6 +-
 .../selftests/bpf/prog_tests/bpf_cookie.c     |   2 +-
 .../selftests/bpf/prog_tests/task_pt_regs.c   |   2 +-
 tools/testing/selftests/bpf/xskxceiver.c      |   2 +-
 11 files changed, 147 insertions(+), 108 deletions(-)
Signature · 1 line
2.30.2