mirror of
https://github.com/torvalds/linux.git
synced 2026-06-23 22:53:12 +02:00
Add selftest for attach types `BPF_CGROUP_INET4_POST_BIND` and `BPF_CGROUP_INET6_POST_BIND`. The main things tested are: * prog load behaves as expected (valid/invalid accesses in prog); * prog attach behaves as expected (load- vs attach-time attach types); * `BPF_CGROUP_INET_SOCK_CREATE` can be attached in a backward compatible way; * post-hooks return expected result and errno. Example: # ./test_sock Test case: bind4 load with invalid access: src_ip6 .. [PASS] Test case: bind4 load with invalid access: mark .. [PASS] Test case: bind6 load with invalid access: src_ip4 .. [PASS] Test case: sock_create load with invalid access: src_port .. [PASS] Test case: sock_create load w/o expected_attach_type (compat mode) .. [PASS] Test case: sock_create load w/ expected_attach_type .. [PASS] Test case: attach type mismatch bind4 vs bind6 .. [PASS] Test case: attach type mismatch bind6 vs bind4 .. [PASS] Test case: attach type mismatch default vs bind4 .. [PASS] Test case: attach type mismatch bind6 vs sock_create .. [PASS] Test case: bind4 reject all .. [PASS] Test case: bind6 reject all .. [PASS] Test case: bind6 deny specific IP & port .. [PASS] Test case: bind4 allow specific IP & port .. [PASS] Test case: bind4 allow all .. [PASS] Test case: bind6 allow all .. [PASS] Summary: 16 PASSED, 0 FAILED Signed-off-by: Andrey Ignatov <rdna@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> |
||
|---|---|---|
| .. | ||
| gnu | ||
| include/uapi/linux | ||
| .gitignore | ||
| bpf_endian.h | ||
| bpf_helpers.h | ||
| bpf_rlimit.h | ||
| bpf_util.h | ||
| cgroup_helpers.c | ||
| cgroup_helpers.h | ||
| config | ||
| connect4_prog.c | ||
| connect6_prog.c | ||
| dev_cgroup.c | ||
| Makefile | ||
| sample_map_ret0.c | ||
| sample_ret0.c | ||
| sockmap_parse_prog.c | ||
| sockmap_tcp_msg_prog.c | ||
| sockmap_verdict_prog.c | ||
| tcp_client.py | ||
| tcp_server.py | ||
| test_align.c | ||
| test_dev_cgroup.c | ||
| test_iptunnel_common.h | ||
| test_kmod.sh | ||
| test_l4lb_noinline.c | ||
| test_l4lb.c | ||
| test_libbpf_open.c | ||
| test_libbpf.sh | ||
| test_lpm_map.c | ||
| test_lru_map.c | ||
| test_maps.c | ||
| test_obj_id.c | ||
| test_offload.py | ||
| test_pkt_access.c | ||
| test_pkt_md_access.c | ||
| test_progs.c | ||
| test_sock_addr.c | ||
| test_sock_addr.sh | ||
| test_sock.c | ||
| test_stacktrace_build_id.c | ||
| test_stacktrace_map.c | ||
| test_tag.c | ||
| test_tcp_estats.c | ||
| test_tcpbpf_kern.c | ||
| test_tcpbpf_user.c | ||
| test_tcpbpf.h | ||
| test_tracepoint.c | ||
| test_verifier_log.c | ||
| test_verifier.c | ||
| test_xdp_meta.c | ||
| test_xdp_meta.sh | ||
| test_xdp_noinline.c | ||
| test_xdp_redirect.c | ||
| test_xdp_redirect.sh | ||
| test_xdp.c | ||
| urandom_read.c | ||