summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/bind4_prog.c
diff options
context:
space:
mode:
authorJordan Rife <jrife@google.com>2024-05-10 14:02:32 -0500
committerAlexei Starovoitov <ast@kernel.org>2024-05-12 17:10:42 -0700
commitdfb7539b47b501ccc0d23bae718500ada2157aee (patch)
treeaf8bfb396616fb4fff15762645efa514dfd30f89 /tools/testing/selftests/bpf/progs/bind4_prog.c
parent1e0a8367c89f82816735973d0e65a3c8e1b43179 (diff)
downloadlinux-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/bind4_prog.c')
-rw-r--r--tools/testing/selftests/bpf/progs/bind4_prog.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/bind4_prog.c b/tools/testing/selftests/bpf/progs/bind4_prog.c
index 66005c1a5b36..b7ddf8ec4ee8 100644
--- a/tools/testing/selftests/bpf/progs/bind4_prog.c
+++ b/tools/testing/selftests/bpf/progs/bind4_prog.c
@@ -158,4 +158,10 @@ int bind_v4_prog(struct bpf_sock_addr *ctx)
return 1;
}
+SEC("cgroup/bind4")
+int bind_v4_deny_prog(struct bpf_sock_addr *ctx)
+{
+ return 0;
+}
+
char _license[] SEC("license") = "GPL";