BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/4] libbpf: Fixes for light skeletons
@ 2026-12-05  1:05 Alexei Starovoitov
  2026-12-05  1:05 ` [PATCH bpf-next 1/4] libbpf, bpftool: Keep places of programs and maps in " Alexei Starovoitov
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Alexei Starovoitov @ 2026-12-05  1:05 UTC (permalink / raw)
  To: bpf; +Cc: daniel, andrii, eddyz87, memxor

From: Alexei Starovoitov <ast@kernel.org>

A light skeleton is the way to build BPF programs into the kernel and to
sign them. Fix what it gets wrong:

  object has                        light skeleton today
  SEC("?...") program               fds of the next programs are shifted
  SEC("?.struct_ops.link") map      the generation fails
  arena with variables              bpftool gets SIGBUS
  jump table                        the loader has an fd of another process
  signature                         rejected with lockdown=confidentiality

Jump tables and an arena with variables or without map_extra are refused.
The rest works.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Alexei Starovoitov (4):
  libbpf, bpftool: Keep places of programs and maps in light skeletons
  libbpf: Do not map an arena in gen_loader
  libbpf: Clear the stack of a loader without a helper
  selftests/bpf: Test places of programs and maps in a light skeleton

 tools/bpf/bpftool/gen.c                       |  7 ++-
 tools/lib/bpf/bpf_gen_internal.h              |  4 +-
 tools/lib/bpf/gen_loader.c                    | 36 ++++-------
 tools/lib/bpf/libbpf.c                        | 46 +++++++++++---
 tools/testing/selftests/bpf/Makefile.skel     |  3 +-
 .../bpf/prog_tests/struct_ops_lskel.c         | 32 ++++++++++
 .../selftests/bpf/progs/struct_ops_places.c   | 63 +++++++++++++++++++
 7 files changed, 152 insertions(+), 39 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/struct_ops_places.c


base-commit: 988a2b6378e65021d5d1e4a001f5005f5bfbaa54
-- 
2.55.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-05  1:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  1:05 [PATCH bpf-next 0/4] libbpf: Fixes for light skeletons Alexei Starovoitov
2026-12-05  1:05 ` [PATCH bpf-next 1/4] libbpf, bpftool: Keep places of programs and maps in " Alexei Starovoitov
2026-12-05  1:25   ` sashiko-bot
2026-12-05  1:05 ` [PATCH bpf-next 2/4] libbpf: Do not map an arena in gen_loader Alexei Starovoitov
2026-12-05  1:05 ` [PATCH bpf-next 3/4] libbpf: Clear the stack of a loader without a helper Alexei Starovoitov
2026-12-05  1:05 ` [PATCH bpf-next 4/4] selftests/bpf: Test places of programs and maps in a light skeleton Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox