diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2022-09-06 17:13:00 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-09-07 11:04:27 -0700 |
commit | fb66223a244f252273995557b23e0fa53092e92c (patch) | |
tree | dcf688c426b2db8ce56f2b755be5f0e7c50b2d38 /net | |
parent | 15baa55ff5b00b81bcd9874b89cb8e0b0daaa13d (diff) | |
download | linux-fb66223a244f252273995557b23e0fa53092e92c.tar.gz linux-fb66223a244f252273995557b23e0fa53092e92c.tar.bz2 linux-fb66223a244f252273995557b23e0fa53092e92c.zip |
selftests/bpf: add test for accessing ctx from syscall program type
We need to also export the kfunc set to the syscall program type,
and then add a couple of eBPF programs that are testing those calls.
The first one checks for valid access, and the second one is OK
from a static analysis point of view but fails at run time because
we are trying to access outside of the allocated memory.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20220906151303.2780789-5-benjamin.tissoires@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bpf/test_run.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index 25d8ecf105aa..f16baf977a21 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -1634,6 +1634,7 @@ static int __init bpf_prog_test_run_init(void) ret = register_btf_kfunc_id_set(BPF_PROG_TYPE_SCHED_CLS, &bpf_prog_test_kfunc_set); ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &bpf_prog_test_kfunc_set); + ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_SYSCALL, &bpf_prog_test_kfunc_set); return ret ?: register_btf_id_dtor_kfuncs(bpf_prog_test_dtor_kfunc, ARRAY_SIZE(bpf_prog_test_dtor_kfunc), THIS_MODULE); |