Message ID | 20221011120108.782373-7-xukuohai@huaweicloud.com (mailing list archive) |
---|---|
State | Accepted |
Commit | cafecc0e3df3a74e35a783759be7c83e6d7f2162 |
Delegated to: | BPF |
Headers | show |
Series | Fix bugs found by ASAN when running selftests | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for bpf-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Series has a cover letter |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/cc_maintainers | success | CCed 20 of 20 maintainers |
netdev/build_clang | success | Errors and warnings before: 0 this patch: 0 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | Fixes tag looks correct |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 24 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
bpf/vmtest-bpf-next-PR | fail | PR summary |
bpf/vmtest-bpf-next-VM_Test-11 | fail | Logs for test_progs on x86_64 with llvm-16 |
bpf/vmtest-bpf-next-VM_Test-15 | success | Logs for test_verifier on s390x with gcc |
bpf/vmtest-bpf-next-VM_Test-6 | success | Logs for test_maps on s390x with gcc |
bpf/vmtest-bpf-next-VM_Test-9 | success | Logs for test_progs on s390x with gcc |
bpf/vmtest-bpf-next-VM_Test-12 | success | Logs for test_progs_no_alu32 on s390x with gcc |
bpf/vmtest-bpf-next-VM_Test-4 | success | Logs for llvm-toolchain |
bpf/vmtest-bpf-next-VM_Test-5 | success | Logs for set-matrix |
bpf/vmtest-bpf-next-VM_Test-2 | success | Logs for build for x86_64 with gcc |
bpf/vmtest-bpf-next-VM_Test-3 | success | Logs for build for x86_64 with llvm-16 |
bpf/vmtest-bpf-next-VM_Test-1 | success | Logs for build for s390x with gcc |
bpf/vmtest-bpf-next-VM_Test-16 | success | Logs for test_verifier on x86_64 with gcc |
bpf/vmtest-bpf-next-VM_Test-17 | success | Logs for test_verifier on x86_64 with llvm-16 |
bpf/vmtest-bpf-next-VM_Test-7 | success | Logs for test_maps on x86_64 with gcc |
bpf/vmtest-bpf-next-VM_Test-8 | success | Logs for test_maps on x86_64 with llvm-16 |
bpf/vmtest-bpf-next-VM_Test-10 | fail | Logs for test_progs on x86_64 with gcc |
bpf/vmtest-bpf-next-VM_Test-13 | fail | Logs for test_progs_no_alu32 on x86_64 with gcc |
bpf/vmtest-bpf-next-VM_Test-14 | fail | Logs for test_progs_no_alu32 on x86_64 with llvm-16 |
On 10/11/22 5:01 AM, Xu Kuohai wrote: > From: Xu Kuohai <xukuohai@huawei.com> > > xdp_adjust_tail.c calls ASSERT_OK() to check the return value of > bpf_prog_test_load(), but the condition is not correct. Fix it. > > Fixes: 791cad025051 ("bpf: selftests: Get rid of CHECK macro in xdp_adjust_tail.c") > Signed-off-by: Xu Kuohai <xukuohai@huawei.com> > --- > tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c > index 009ee37607df..39973ea1ce43 100644 > --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c > +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c > @@ -18,7 +18,7 @@ static void test_xdp_adjust_tail_shrink(void) > ); > > err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); > - if (ASSERT_OK(err, "test_xdp_adjust_tail_shrink")) > + if (!ASSERT_OK(err, "test_xdp_adjust_tail_shrink")) > return; > > err = bpf_prog_test_run_opts(prog_fd, &topts); > @@ -53,7 +53,7 @@ static void test_xdp_adjust_tail_grow(void) > ); > > err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); > - if (ASSERT_OK(err, "test_xdp_adjust_tail_grow")) > + if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow")) Ouch... ic. It is why this test has been passing. > return; > > err = bpf_prog_test_run_opts(prog_fd, &topts); > @@ -90,7 +90,7 @@ static void test_xdp_adjust_tail_grow2(void) > ); > > err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); > - if (ASSERT_OK(err, "test_xdp_adjust_tail_grow")) > + if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow")) > return; > > /* Test case-64 */
On 10/13/2022 7:26 AM, Martin KaFai Lau wrote: > On 10/11/22 5:01 AM, Xu Kuohai wrote: >> From: Xu Kuohai <xukuohai@huawei.com> >> >> xdp_adjust_tail.c calls ASSERT_OK() to check the return value of >> bpf_prog_test_load(), but the condition is not correct. Fix it. >> >> Fixes: 791cad025051 ("bpf: selftests: Get rid of CHECK macro in xdp_adjust_tail.c") >> Signed-off-by: Xu Kuohai <xukuohai@huawei.com> >> --- >> tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c >> index 009ee37607df..39973ea1ce43 100644 >> --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c >> +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c >> @@ -18,7 +18,7 @@ static void test_xdp_adjust_tail_shrink(void) >> ); >> err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); >> - if (ASSERT_OK(err, "test_xdp_adjust_tail_shrink")) >> + if (!ASSERT_OK(err, "test_xdp_adjust_tail_shrink")) >> return; >> err = bpf_prog_test_run_opts(prog_fd, &topts); >> @@ -53,7 +53,7 @@ static void test_xdp_adjust_tail_grow(void) >> ); >> err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); >> - if (ASSERT_OK(err, "test_xdp_adjust_tail_grow")) >> + if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow")) > > Ouch... ic. It is why this test has been passing. > Well, it's because the value of err is zero, so ASSERT_OK passed. > >> return; >> err = bpf_prog_test_run_opts(prog_fd, &topts); >> @@ -90,7 +90,7 @@ static void test_xdp_adjust_tail_grow2(void) >> ); >> err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); >> - if (ASSERT_OK(err, "test_xdp_adjust_tail_grow")) >> + if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow")) >> return; >> /* Test case-64 */ > > .
diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c index 009ee37607df..39973ea1ce43 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c @@ -18,7 +18,7 @@ static void test_xdp_adjust_tail_shrink(void) ); err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); - if (ASSERT_OK(err, "test_xdp_adjust_tail_shrink")) + if (!ASSERT_OK(err, "test_xdp_adjust_tail_shrink")) return; err = bpf_prog_test_run_opts(prog_fd, &topts); @@ -53,7 +53,7 @@ static void test_xdp_adjust_tail_grow(void) ); err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); - if (ASSERT_OK(err, "test_xdp_adjust_tail_grow")) + if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow")) return; err = bpf_prog_test_run_opts(prog_fd, &topts); @@ -90,7 +90,7 @@ static void test_xdp_adjust_tail_grow2(void) ); err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); - if (ASSERT_OK(err, "test_xdp_adjust_tail_grow")) + if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow")) return; /* Test case-64 */