]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: add tests for attaching invalid fd
authorKohei Enju <enjuk@amazon.com>
Mon, 8 Dec 2025 13:14:32 +0000 (22:14 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 10 Dec 2025 07:53:27 +0000 (23:53 -0800)
commit18352f8fae91d23bbd7165a7b2a1f15c4f5beff8
tree1ad41efdad5f73ee9ba1adb8e54d85e6667a5256
parent48e11bad9a1fd803a22d25c9a7d3aced1ba87817
selftests/bpf: add tests for attaching invalid fd

Add test cases for situations where adding the following types of file
descriptors to a cpumap entry should fail:
- Non-BPF file descriptor (expect -EINVAL)
- Nonexistent file descriptor (expect -EBADF)

Also tighten the assertion for the expected error when adding a
non-BPF_XDP_CPUMAP program to a cpumap entry.

Signed-off-by: Kohei Enju <enjuk@amazon.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20251208131449.73036-3-enjuk@amazon.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c