]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Excercise bpf_obj_get_info_by_fd for bpf2bpf
authorStanislav Fomichev <sdf@google.com>
Thu, 4 Aug 2022 20:11:40 +0000 (13:11 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 8 Aug 2022 13:53:39 +0000 (15:53 +0200)
commitff67ab5fc646f2b6aa60c3557a9f47b9d693399e
treee398b0d1fa05fcf45f7b34f0238204607f89a78a
parent7f433c98098442cac623b9e3301dae18e77f531b
selftests/bpf: Excercise bpf_obj_get_info_by_fd for bpf2bpf

Apparently, no existing selftest covers it. Add a new one where
we load cgroup/bind4 program and attach fentry to it. Calling
bpf_obj_get_info_by_fd on the fentry program should return non-zero
btf_id/btf_obj_id instead of crashing the kernel.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20220804201140.1340684-2-sdf@google.com
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c