diff options
author | Yonghong Song <yhs@fb.com> | 2020-12-09 17:33:50 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-12-14 21:50:10 +0100 |
commit | b4b638c36b7e7acd847b9c4b9c80f268e45ea30c (patch) | |
tree | e57bb1465df207af5c0987249b17c66606ca5e70 /tools/testing/selftests/bpf/verifier/unpriv.c | |
parent | cd17d38f8b28f808c368121041c0a4fa91757e0d (diff) | |
download | linux-b4b638c36b7e7acd847b9c4b9c80f268e45ea30c.tar.bz2 |
selftests/bpf: Add a test for ptr_to_map_value on stack for helper access
Change bpf_iter_task.c such that pointer to map_value may appear
on the stack for bpf_seq_printf() to access. Without previous
verifier patch, the bpf_iter test will fail.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20201210013350.943985-1-yhs@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/verifier/unpriv.c')
-rw-r--r-- | tools/testing/selftests/bpf/verifier/unpriv.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/verifier/unpriv.c b/tools/testing/selftests/bpf/verifier/unpriv.c index 91bb77c24a2e..a3fe0fbaed41 100644 --- a/tools/testing/selftests/bpf/verifier/unpriv.c +++ b/tools/testing/selftests/bpf/verifier/unpriv.c @@ -108,8 +108,9 @@ BPF_EXIT_INSN(), }, .fixup_map_hash_8b = { 3 }, - .errstr = "invalid indirect read from stack off -8+0 size 8", - .result = REJECT, + .errstr_unpriv = "invalid indirect read from stack off -8+0 size 8", + .result_unpriv = REJECT, + .result = ACCEPT, }, { "unpriv: mangle pointer on stack 1", |