diff options
author | Alexei Starovoitov <ast@kernel.org> | 2021-11-01 15:21:53 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2021-11-01 18:05:12 -0700 |
commit | 0869e5078afbd1b22c20832b391b2d85291bc0a8 (patch) | |
tree | 897e20cf1eba018a44b23d3362a05891de855e81 /tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c | |
parent | 388e2c0b978339dee9b0a81a2e546f8979e021e2 (diff) | |
download | linux-0869e5078afbd1b22c20832b391b2d85291bc0a8.tar.gz linux-0869e5078afbd1b22c20832b391b2d85291bc0a8.tar.bz2 linux-0869e5078afbd1b22c20832b391b2d85291bc0a8.zip |
selftests/bpf: Add a testcase for 64-bit bounds propagation issue.
./test_progs-no_alu32 -vv -t twfw
Before the 64-bit_into_32-bit fix:
19: (25) if r1 > 0x3f goto pc+6
R1_w=inv(id=0,umax_value=63,var_off=(0x0; 0xff),s32_max_value=255,u32_max_value=255)
and eventually:
invalid access to map value, value_size=8 off=7 size=8
R6 max value is outside of the allowed memory range
libbpf: failed to load object 'no_alu32/twfw.o'
After the fix:
19: (25) if r1 > 0x3f goto pc+6
R1_w=inv(id=0,umax_value=63,var_off=(0x0; 0x3f))
verif_twfw:OK
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20211101222153.78759-3-alexei.starovoitov@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c index 867349e4ed9e..27f5d8ea7964 100644 --- a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c +++ b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c @@ -202,3 +202,8 @@ void test_verif_scale_seg6_loop() { scale_test("test_seg6_loop.o", BPF_PROG_TYPE_LWT_SEG6LOCAL, false); } + +void test_verif_twfw() +{ + scale_test("twfw.o", BPF_PROG_TYPE_CGROUP_SKB, false); +} |