Typeless/weak ksym for gen_loader + misc fixups
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest8 patches 6 repliesIn review
- v48 patches 7 repliesSuperseded
- v38 patches 5 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 8 patches | 5 replies | Superseded | |
| v1 | 6 patches | 20 replies | Superseded |
Changes in v5 from the cover letter
v4: https://lore.kernel.org/bpf/[email protected]
* Address feedback from Andrii
* Drop use of ensure_good_fd in unneeded call sites
* Add sys_bpf_fd
* Add _lskel suffix to all light skeletons and change all current selftests
* Drop early break in close loop for sk_lookup
* Fix other nits
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | bpf: Add bpf_kallsyms_lookup_name helperinclude/ include/ kernel/ +1 more | +60 | 1 reply | |
| 2/8 | libbpf: Add typeless ksym support to gen_loadertools/ tools/ tools/ | +99 | 0 replies | |
| 3/8 | libbpf: Add weak ksym support to gen_loadertools/ | +32 | 2 replies | |
| 4/8 | libbpf: Ensure that BPF syscall fds are never 0, 1, or 2tools/ tools/ | +46 | 1 reply | |
| 5/8 | libbpf: Use O_CLOEXEC uniformly when opening fdstools/ tools/ tools/ +2 more | +10 | 1 reply | |
| 6/8 | selftests/bpf: Add weak/typeless ksym test for light skeletontools/ tools/ tools/ +12 more | +142 | 1 reply | |
| 7/8 | selftests/bpf: Fix fd cleanup in sk_lookup testtools/ | +2 | 0 replies | |
| 8/8 | selftests/bpf: Fix memory leak in test_imatools/ | +2 | 0 replies |
Reviews trailers per patch
6 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Song Liu | Jakub Sitnicki | Andrii Nakryiko |
|---|---|---|---|
| 1/8 | A-b | ||
| 2/8 | |||
| 3/8 | |||
| 4/8 | A-b | A-b | |
| 5/8 | A-b | ||
| 6/8 | A-b | ||
| 7/8 | A-b | R-b | |
| 8/8 | A-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH bpf-next v5 0/8] Typeless/weak ksym for gen_loader + misc fixups
Patches (1,2,3,6) add typeless and weak ksym support to gen_loader. It is follow up for the recent kfunc from modules series.
The later patches (7,8) are misc fixes for selftests, and patch 4 for libbpf where we try to be careful to not end up with fds == 0, as libbpf assumes in various places that they are greater than 0. Patch 5 fixes up missing O_CLOEXEC in libbpf.
Changelog:
----------
v4 -> v5
v4: https://lore.kernel.org/bpf/[email protected]
* Address feedback from Andrii
* Drop use of ensure_good_fd in unneeded call sites
* Add sys_bpf_fd
* Add _lskel suffix to all light skeletons and change all current selftests
* Drop early break in close loop for sk_lookup
* Fix other nits
v3 -> v4
v3: https://lore.kernel.org/bpf/[email protected]
* Remove gpl_only = true from bpf_kallsyms_lookup_name (Alexei)
* Add bpf_dump_raw_ok check to ensure kptr_restrict isn't bypassed (Alexei)
v2 -> v3
v2: https://lore.kernel.org/bpf/[email protected]
* Address feedback from Song
* Move ksym logging to separate helper to avoid code duplication
* Move src_reg mask stuff to separate helper
* Fix various other nits, add acks
* __builtin_expect is used instead of likely to as skel_internal.h is included in isolation.
v1 -> v2
v1: https://lore.kernel.org/bpf/[email protected]
* Remove redundant OOM checks in emit_bpf_kallsyms_lookup_name
* Use designated initializer for sk_lookup fd array (Jakub)
* Do fd check for all fd returning low level APIs (Andrii, Alexei)
* Make Fixes: tag quote commit message, use selftests/bpf prefix (Song, Andrii)
* Split typeless and weak ksym support into separate patches, expand commit message (Song)
* Fix duplication in selftests stemming from use of LSKELS_EXTRA (Song)
Kumar Kartikeya Dwivedi (8):
bpf: Add bpf_kallsyms_lookup_name helper
libbpf: Add typeless ksym support to gen_loader
libbpf: Add weak ksym support to gen_loader
libbpf: Ensure that BPF syscall fds are never 0, 1, or 2
libbpf: Use O_CLOEXEC uniformly when opening fds selftests/bpf: Add weak/typeless ksym test for light skeleton selftests/bpf: Fix fd cleanup in sk_lookup test selftests/bpf: Fix memory leak in test_ima
include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 16 +++ kernel/bpf/syscall.c | 27 ++++ tools/include/uapi/linux/bpf.h | 16 +++ tools/lib/bpf/bpf.c | 35 +++-- tools/lib/bpf/bpf_gen_internal.h | 12 +- tools/lib/bpf/btf.c | 2 +- tools/lib/bpf/gen_loader.c | 132 ++++++++++++++++-- tools/lib/bpf/libbpf.c | 19 ++- tools/lib/bpf/libbpf_internal.h | 24 ++++ tools/lib/bpf/libbpf_probes.c | 2 +- tools/lib/bpf/linker.c | 4 +- tools/lib/bpf/xsk.c | 6 +- tools/testing/selftests/bpf/Makefile | 4 +- .../selftests/bpf/prog_tests/atomics.c | 34 ++--- .../selftests/bpf/prog_tests/fentry_fexit.c | 16 +-- .../selftests/bpf/prog_tests/fentry_test.c | 14 +- .../selftests/bpf/prog_tests/fexit_sleep.c | 12 +- .../selftests/bpf/prog_tests/fexit_test.c | 14 +- .../selftests/bpf/prog_tests/kfunc_call.c | 6 +- .../selftests/bpf/prog_tests/ksyms_btf.c | 35 ++++- .../selftests/bpf/prog_tests/ksyms_module.c | 40 +++++- .../bpf/prog_tests/ksyms_module_libbpf.c | 28 ---- .../selftests/bpf/prog_tests/ringbuf.c | 12 +- .../selftests/bpf/prog_tests/sk_lookup.c | 4 +- .../selftests/bpf/prog_tests/test_ima.c | 3 +- .../selftests/bpf/prog_tests/trace_printk.c | 14 +- .../selftests/bpf/prog_tests/trace_vprintk.c | 12 +- .../selftests/bpf/prog_tests/verif_stats.c | 6 +- .../selftests/bpf/progs/test_ksyms_weak.c | 2 +- 30 files changed, 393 insertions(+), 159 deletions(-) delete mode 100644 tools/testing/selftests/bpf/prog_tests/ksyms_module_libbpf.c
Signature · 1 line
2.33.1