libbpf: don't fail when feature probing fails
Subsystems (4)
PATCH 1/1 libbpf: don't fail when feature probing fails
Otherwise libbpf is unusable from unprivileged process with kernel.kernel.unprivileged_bpf_disabled=1.
All I get is EPERM from the probes, even if I just want to open an ELF object and look at what progs/maps it has.
Instead of dying on probes, let's just pr_debug the error and try to continue.
Signed-off-by Stanislav Fomichev <[email protected]>
--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
@@ -1696,7 +1696,7 @@ bpf_object__probe_caps(struct bpf_object *obj)for (i =0 ; i <ARRAY_SIZE (probe_fn); i++) { ret = probe_fn[i](obj);if (ret <0 ) -return ret; +pr_debug ("Probe #%d failed with %d.\n" , i, ret); }return 0 ;
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
Daniel Borkmann
maintainerQuoted 9 lines · Stanislav Fomichev
Otherwise libbpf is unusable from unprivileged process with kernel.kernel.unprivileged_bpf_disabled=1.
All I get is EPERM from the probes, even if I just want to open an ELF object and look at what progs/maps it has.Instead of dying on probes, let's just
pr_debugthe error and try to continue.Signed-off-by Stanislav Fomichev <[email protected]>
Good catch, applied, thanks!