diff options
author | 2021-04-16 13:47:04 -0700 | |
---|---|---|
committer | 2021-04-19 18:23:33 -0700 | |
commit | c77cec5c207b68a3cbc2af2f81070ec428f41145 (patch) | |
tree | 0a40b8c3beeb6f735fc54e932bdd5a85ad8ec3d8 /tools/testing/selftests/bpf/prog_tests/bpf_iter.c | |
parent | bpf/selftests: Add bpf_get_task_stack retval bounds verifier test (diff) | |
download | linux-c77cec5c207b68a3cbc2af2f81070ec428f41145.tar.gz linux-c77cec5c207b68a3cbc2af2f81070ec428f41145.tar.bz2 linux-c77cec5c207b68a3cbc2af2f81070ec428f41145.zip |
bpf/selftests: Add bpf_get_task_stack retval bounds test_prog
Add a libbpf test prog which feeds bpf_get_task_stack's return value
into seq_write after confirming it's positive. No attempt to bound the
value from above is made.
Load will fail if verifier does not refine retval range based on buf sz
input to bpf_get_task_stack.
Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20210416204704.2816874-4-davemarchevsky@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/bpf_iter.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/bpf_iter.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c index 74c45d557a2b..2d3590cfb5e1 100644 --- a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c +++ b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c @@ -147,6 +147,7 @@ static void test_task_stack(void) return; do_dummy_read(skel->progs.dump_task_stack); + do_dummy_read(skel->progs.get_task_user_stacks); bpf_iter_task_stack__destroy(skel); } |