]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: test for malformed BPF_CORE_TYPE_ID_LOCAL relocation
authorEduard Zingerman <eddyz87@gmail.com>
Thu, 22 Aug 2024 08:01:24 +0000 (01:01 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 22 Aug 2024 15:00:26 +0000 (08:00 -0700)
commit110bbd3a2ed71f3cf4d9438d62f22f591952fc3b
tree726007f282195c6268baae1ef0da63f4535bff47
parent3d2786d65aaa954ebd3fcc033ada433e10da21c4
selftests/bpf: test for malformed BPF_CORE_TYPE_ID_LOCAL relocation

Check that verifier rejects BPF program containing relocation
pointing to non-existent BTF type.

To force relocation resolution on kernel side test case uses
bpf_attr->core_relos field. This field is not exposed by libbpf,
so directly do BPF system call in the test.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20240822080124.2995724-3-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/core_reloc_raw.c [new file with mode: 0644]