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: <YoHKw/at89Wp19F/@Laptop-X1>
Date:   Mon, 16 May 2022 11:53:39 +0800
From:   Hangbin Liu <liuhangbin@...il.com>
To:     Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc:     Networking <netdev@...r.kernel.org>, Shuah Khan <shuah@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Ilya Leoshkevich <iii@...ux.ibm.com>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH net 1/2] selftests/bpf: Fix build error with ima_setup.sh

On Fri, May 13, 2022 at 02:58:05PM -0700, Andrii Nakryiko wrote:
> > -TRUNNER_EXTRA_FILES := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \
> > -                      ima_setup.sh                                     \
> > +TRUNNER_EXTRA_BUILD := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \
> >                        $(wildcard progs/btf_dump_test_case_*.c)
> 
> 
> note that progs/btf_dump_test_case_*.c are not built, they are just
> copied over (C source files), so I don't think this fix is necessary.
> 
> btw, I tried running `OUTPUT="/tmp/bpf" make test_progs` and it didn't
> error out. But tbh, I'd recommend building everything instead of
> building individual targets.

After update the code to latest bpf-next. It works this time, the ima_setup.sh
was copied to target folder correctly. 

  EXT-COPY [test_progs] urandom_read bpf_testmod.ko liburandom_read.so ima_setup.sh btf_dump_test_case_bitfields.c btf_dump_test_case_multidim.c btf_dump_test_case_namespacing.c btf_dump_test_case_ordering.c btf_dump_test_case_packing.c btf_dump_test_case_padding.c btf_dump_test_case_syntax.c
  BINARY   test_progs

Not sure why the previous kernel doesn't work. But anyway I will drop this patch.

On the other hand, when I build with latest bpf-next. I got error like:

"""
# OUTPUT="/tmp/bpf" make test_progs
  BINARY   urandom_read                                                                                                                                                       gcc -g -O0 -rdynamic -Wall -Werror -DHAVE_GENHDR  -I/home/net/tools/testing/selftests/bpf -I/tmp/bpf/tools/include -I/home/net/include/generated -I/home/net/tools/lib -I/home/net/tools/include -I/home/net/tools/include/uapi -I/tmp/bpf  urandom_read.c urandom_read_aux.c  \
          liburandom_read.so -lelf -lz -lrt -lpthread   \
          -Wl,-rpath=. -Wl,--build-id=sha1 -o /tmp/bpf/urandom_read
/usr/bin/ld: cannot find liburandom_read.so: No such file or directory                                                                                                        collect2: error: ld returned 1 exit status
make: *** [Makefile:177: /tmp/bpf/urandom_read] Error 1

# ls /tmp/bpf/liburandom_read.so
/tmp/bpf/liburandom_read.so
"""

after I copy to liburandom_read.so back to tools/testing/selftests/bpf the build
success.

"""
# cp /tmp/bpf/liburandom_read.so /home/net/tools/testing/selftests/bpf/
# gcc -g -O0 -rdynamic -Wall -Werror -DHAVE_GENHDR -I/home/net/tools/testing/selftests/bpf -I/tmp/bpf/tools/include -I/home/net/include/generated -I/home/net/tools/lib -I/home/net/tools/include -I/home/net/tools/include/uapi -I/tmp/bpf  urandom_read.c urandom_read_aux.c liburandom_read.so -lelf -lz -lrt -lpthread -Wl,-rpath=. -Wl,--build-id=sha1 -o /tmp/bpf/urandom_read
# echo $?
0
"""

Do you know why this happens?

Thanks
Hangbin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ