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: <611e9bed-df6a-0da9-fbf9-4046f4211a7d@linux.dev>
Date:   Wed, 12 Oct 2022 16:17:51 -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 5/6] selftests/bpf: Fix error failure of case
 test_xdp_adjust_tail_grow

On 10/11/22 5:01 AM, Xu Kuohai wrote:
> From: Xu Kuohai <xukuohai@...wei.com>
> 
> test_xdp_adjust_tail_grow failed with ipv6:
>    test_xdp_adjust_tail_grow:FAIL:ipv6 unexpected error: -28 (errno 28)
> 
> The reason is that this test case tests ipv4 before ipv6, and when ipv4
> test finished, topts.data_size_out was set to 54, which is smaller than the
> ipv6 output data size 114, so ipv6 test fails with NOSPC error.
> 
> Fix it by reset topts.data_size_out to sizeof(buf) before testing ipv6.
> 
> Fixes: 04fcb5f9a104 ("selftests/bpf: Migrate from bpf_prog_test_run")
> Signed-off-by: Xu Kuohai <xukuohai@...wei.com>
> ---
>   tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> 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 9b9cf8458adf..009ee37607df 100644
> --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c
> +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c
> @@ -63,6 +63,7 @@ static void test_xdp_adjust_tail_grow(void)
>   	expect_sz = sizeof(pkt_v6) + 40; /* Test grow with 40 bytes */
>   	topts.data_in = &pkt_v6;
>   	topts.data_size_in = sizeof(pkt_v6);
> +	topts.data_size_out = sizeof(buf);

lgtm but how was it working before... weird.

>   	err = bpf_prog_test_run_opts(prog_fd, &topts);
>   	ASSERT_OK(err, "ipv6");
>   	ASSERT_EQ(topts.retval, XDP_TX, "ipv6 retval");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ