> libbpf: Skip bpf_object__probe_loading() when BPF token is in use
>
>     bpf_object__probe_loading() tries to load trivial SOCKET_FILTER and
>     TRACEPOINT programs to verify the BPF environment works.  When a
>     BPF token is in use with restricted program type permissions, these
>     probe loads may fail because the token does not allow the specific
>     program types, even though BPF loading is perfectly functional.
>
>     Fix by skipping the probe when a token FD is present: BPF token
>     creation itself proves the kernel has a working BPF subsystem.
>     Real BPF issues will be caught during actual program and map loading.
>
>     Signed-off-by: Yuan Chen <[email protected]>

This looks like a fix for a regression that was introduced when the BPF
token was first wired into the probe loads, which switched the trivial
SOCKET_FILTER/TRACEPOINT bpf_prog_load() probe calls from passing NULL to
passing &opts with .token_fd = obj->token_fd, making the probes subject to
the token's restricted program-type permissions.

Should this include:

  Fixes: 1d0dd6ea2e38 ("libbpf: wire up BPF token support at BPF object level")


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/26928747574

Reply via email to