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] [day] [month] [year] [list]
Date:   Fri, 16 Dec 2022 10:34:04 +0100
From:   Björn Töpel <bjorn@...nel.org>
To:     Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Shuah Khan <shuah@...nel.org>,
        David Ahern <dsahern@...nel.org>,
        Lina Wang <lina.wang@...iatek.com>,
        Coleman Dietsch <dietschc@....edu>, bpf@...r.kernel.org,
        Maciej enczykowski <maze@...gle.com>,
        Björn Töpel 
        <bjorn@...osinc.com>, Hangbin Liu <liuhangbin@...il.com>
Subject: Re: [PATCHv2 net-next] selftests/net: mv bpf/nat6to4.c to net folder

Hangbin Liu <liuhangbin@...il.com> writes:

> There are some issues with the bpf/nat6to4.c building.
>
> 1. It use TEST_CUSTOM_PROGS, which will add the nat6to4.o to
>    kselftest-list file and run by common run_tests.
> 2. When building the test via `make -C tools/testing/selftests/
>    TARGETS="net"`, the nat6to4.o will be build in selftests/net/bpf/
>    folder. But in test udpgro_frglist.sh it refers to ../bpf/nat6to4.o.
>    The correct path should be ./bpf/nat6to4.o.
> 3. If building the test via `make -C tools/testing/selftests/ TARGETS="net"
>    install`. The nat6to4.o will be installed to kselftest_install/net/
>    folder. Then the udpgro_frglist.sh should refer to ./nat6to4.o.
>
> To fix the confusing test path, let's just move the nat6to4.c to net folder
> and build it as TEST_GEN_FILES.
>
> v2: Update the Makefile rules rely on commit 837a3d66d698 ("selftests:
> net: Add cross-compilation support for BPF programs").
>
> Fixes: edae34a3ed92 ("selftests net: add UDP GRO fraglist + bpf self-tests")
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>

FWIW, tested cross-compilation on riscv (and minor nit below):

Tested-by: Björn Töpel <bjorn@...nel.org>

> diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
> index 3007e98a6d64..ed9a315187c1 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -75,14 +75,60 @@ TEST_GEN_PROGS += so_incoming_cpu
>  TEST_PROGS += sctp_vrf.sh
>  TEST_GEN_FILES += sctp_hello
>  TEST_GEN_FILES += csum
> +TEST_GEN_FILES += nat6to4.o
>  
>  TEST_FILES := settings
>  
>  include ../lib.mk
>  
> -include bpf/Makefile
> -
>  $(OUTPUT)/reuseport_bpf_numa: LDLIBS += -lnuma
>  $(OUTPUT)/tcp_mmap: LDLIBS += -lpthread
>  $(OUTPUT)/tcp_inq: LDLIBS += -lpthread
>  $(OUTPUT)/bind_bhash: LDLIBS += -lpthread
> +
> +# Rules to generate bpf obj nat6to4.o
> +CLANG ?= clang
> +SCRATCH_DIR := $(OUTPUT)/tools
> +BUILD_DIR := $(SCRATCH_DIR)/build
> +BPFDIR := $(abspath ../../../lib/bpf)
> +APIDIR := $(abspath ../../../include/uapi)
> +
> +CCINCLUDE += -I../bpf
> +CCINCLUDE += -I../../../../usr/include/
> +CCINCLUDE += -I$(SCRATCH_DIR)/include
> +
> +BPFOBJ := $(BUILD_DIR)/libbpf/libbpf.a
> +
> +MAKE_DIRS := $(BUILD_DIR)/libbpf $(OUTPUT)/bpf
                                    ^^^^^^^^^^^^^
                                    Can be removed after the BPF-prog
                                    moved out from /bpf

Björn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ