aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/sendmsg_unix_prog.c
diff options
context:
space:
mode:
authorJordan Rife <[email protected]>2024-05-10 19:02:32 +0000
committerAlexei Starovoitov <[email protected]>2024-05-13 00:10:42 +0000
commitdfb7539b47b501ccc0d23bae718500ada2157aee (patch)
treeaf8bfb396616fb4fff15762645efa514dfd30f89 /tools/testing/selftests/bpf/progs/sendmsg_unix_prog.c
parentselftests/bpf: Expand sockaddr program return value tests (diff)
downloadkernel-dfb7539b47b501ccc0d23bae718500ada2157aee.tar.gz
kernel-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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/sendmsg_unix_prog.c')
-rw-r--r--tools/testing/selftests/bpf/progs/sendmsg_unix_prog.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/sendmsg_unix_prog.c b/tools/testing/selftests/bpf/progs/sendmsg_unix_prog.c
index d8869b03dda9..332d0eb1116f 100644
--- a/tools/testing/selftests/bpf/progs/sendmsg_unix_prog.c
+++ b/tools/testing/selftests/bpf/progs/sendmsg_unix_prog.c
@@ -36,4 +36,10 @@ int sendmsg_unix_prog(struct bpf_sock_addr *ctx)
return 1;
}
+SEC("cgroup/sendmsg_unix")
+int sendmsg_unix_deny_prog(struct bpf_sock_addr *ctx)
+{
+ return 0;
+}
+
char _license[] SEC("license") = "GPL";