diff options
author | Jordan Rife <jrife@google.com> | 2024-05-10 14:02:32 -0500 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-05-12 17:10:42 -0700 |
commit | dfb7539b47b501ccc0d23bae718500ada2157aee (patch) | |
tree | af8bfb396616fb4fff15762645efa514dfd30f89 /tools/testing/selftests/bpf/progs/connect4_prog.c | |
parent | 1e0a8367c89f82816735973d0e65a3c8e1b43179 (diff) | |
download | linux-dfb7539b47b501ccc0d23bae718500ada2157aee.tar.gz linux-dfb7539b47b501ccc0d23bae718500ada2157aee.tar.bz2 linux-dfb7539b47b501ccc0d23bae718500ada2157aee.zip |
sefltests/bpf: Expand sockaddr hook deny tests
This patch expands test coverage for EPERM tests to include connect and
bind calls and rounds out the coverage for sendmsg by adding tests for
sendmsg_unix.
Signed-off-by: Jordan Rife <jrife@google.com>
Link: https://lore.kernel.org/r/20240510190246.3247730-16-jrife@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/connect4_prog.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/connect4_prog.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/connect4_prog.c b/tools/testing/selftests/bpf/progs/connect4_prog.c index bec529da7c9d..9e9ebf27b878 100644 --- a/tools/testing/selftests/bpf/progs/connect4_prog.c +++ b/tools/testing/selftests/bpf/progs/connect4_prog.c @@ -199,4 +199,10 @@ int connect_v4_prog(struct bpf_sock_addr *ctx) return do_bind(ctx) ? 1 : 0; } +SEC("cgroup/connect4") +int connect_v4_deny_prog(struct bpf_sock_addr *ctx) +{ + return 0; +} + char _license[] SEC("license") = "GPL"; |