lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <33d17f23-03cb-9bff-2e50-06ab0f597640@linux.dev>
Date:   Wed, 12 Oct 2022 16:26:05 -0700
From:   Martin KaFai Lau <martin.lau@...ux.dev>
To:     Xu Kuohai <xukuohai@...weicloud.com>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Stanislav Fomichev <sdf@...gle.com>,
        Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
        Mykola Lysenko <mykolal@...com>, Shuah Khan <shuah@...nel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        Kumar Kartikeya Dwivedi <memxor@...il.com>,
        Alan Maguire <alan.maguire@...cle.com>,
        Delyan Kratunov <delyank@...com>,
        Lorenzo Bianconi <lorenzo@...nel.org>, bpf@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH bpf-next v4 6/6] selftest/bpf: Fix error usage of
 ASSERT_OK in xdp_adjust_tail.c

On 10/11/22 5:01 AM, Xu Kuohai wrote:
> From: Xu Kuohai <xukuohai@...wei.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@...wei.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 */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ