]> 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)
commitfaf21d281269c377d0fef6803bcb19b6311afd24
treee398b0d1fa05fcf45f7b34f0238204607f89a78a
parentcd3d51f3e80f51770c8e093caa7a26bb685fb8f2
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