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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 29 Sep 2020 22:59:27 +0200
From:   Toke Høiland-Jørgensen <toke@...hat.com>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     Daniel Borkmann <daniel@...earbox.net>,
        Alexei Starovoitov <ast@...com>, bpf <bpf@...r.kernel.org>,
        Network Development <netdev@...r.kernel.org>,
        Martin KaFai Lau <kafai@...com>
Subject: Re: [PATCH bpf-next] selftests: Make sure all 'skel' variables are
 declared static

Alexei Starovoitov <alexei.starovoitov@...il.com> writes:

> On Tue, Sep 29, 2020 at 5:32 AM Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>>
>> If programs in prog_tests using skeletons declare the 'skel' variable as
>> global but not static, that will lead to linker errors on the final link of
>> the prog_tests binary due to duplicate symbols. Fix a few instances of this.
>>
>> Fixes: b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to use skel and global variables")
>> Fixes: 9a856cae2217 ("bpf: selftest: Add test_btf_skc_cls_ingress")
>> Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
>
> Thanks for the fix. Applied.

You're welcome! And thanks :)

> I wonder why we don't see it with different gcc and clang versions.

Yeah, I was wondering about that as well, actually...

> What linker do you use?
> And what kind of error do you see?

  BINARY   test_progs
/usr/bin/ld: /home/build/linux/tools/testing/selftests/bpf/sock_fields.test.o:/home/build/linux/tools/testing/selftests/bpf/prog_tests/sock_fields.c:39: multiple definition of `skel'; /home/build/linux/tools/testing/selftests/bpf/btf_skc_cls_ingress.test.o:/home/build/linux/tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c:19: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:397: /home/build/linux/tools/testing/selftests/bpf/test_progs] Error 1

$  ld --version
GNU ld (GNU Binutils) 2.35

$ gcc --version
gcc (GCC) 10.2.0

-Toke

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ