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  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]
Date:   Sat, 2 Jan 2021 14:25:34 -0800
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Qais Yousef <qais.yousef@....com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: BTFIDS: FAILED unresolved symbol udp6_sock

On Wed, Dec 30, 2020 at 5:28 AM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Wed, Dec 30, 2020 at 10:03:37AM +0100, Jiri Olsa wrote:
> > On Tue, Dec 29, 2020 at 11:28:35PM +0000, Qais Yousef wrote:
> > > Hi Jiri
> > >
> > > On 12/29/20 18:34, Jiri Olsa wrote:
> > > > On Tue, Dec 29, 2020 at 03:13:52PM +0000, Qais Yousef wrote:
> > > > > Hi
> > > > >
> > > > > When I enable CONFIG_DEBUG_INFO_BTF I get the following error in the BTFIDS
> > > > > stage
> > > > >
> > > > >         FAILED unresolved symbol udp6_sock
> > > > >
> > > > > I cross compile for arm64. My .config is attached.
> > > > >
> > > > > I managed to reproduce the problem on v5.9 and v5.10. Plus 5.11-rc1.
> > > > >
> > > > > Have you seen this before? I couldn't find a specific report about this
> > > > > problem.
> > > > >
> > > > > Let me know if you need more info.
> > > >
> > > > hi,
> > > > this looks like symptom of the gcc DWARF bug we were
> > > > dealing with recently:
> > > >
> > > >   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060
> > > >   https://lore.kernel.org/lkml/CAE1WUT75gu9G62Q9uAALGN6vLX=o7vZ9uhqtVWnbUV81DgmFPw@mail.gmail.com/#r
> > > >
> > > > what pahole/gcc version are you using?
> > >
> > > I'm on gcc 9.3.0
> > >
> > >     aarch64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
> > >
> > > I was on pahole v1.17. I moved to v1.19 but I still see the same problem.
> >
> > I can reproduce with your .config, but make 'defconfig' works,
> > so I guess it's some config option issue, I'll check later today
>
> so your .config has
>   CONFIG_CRYPTO_DEV_BCM_SPU=y
>
> and that defines 'struct device_private' which
> clashes with the same struct defined in drivers/base/base.h
>
> so several networking structs will be doubled, like net_device:
>
>         $ bpftool btf dump file ../vmlinux.config | grep net_device\' | grep STRUCT
>         [2731] STRUCT 'net_device' size=2240 vlen=133
>         [113981] STRUCT 'net_device' size=2240 vlen=133
>
> each is using different 'struct device_private' when it's unwinded
>
> and that will confuse BTFIDS logic, becase we have multiple structs
> with the same name, and we can't be sure which one to pick
>
> perhaps we should check on this in pahole and warn earlier with
> better error message.. I'll check, but I'm not sure if pahole can
> survive another hastab ;-)
>
> Andrii, any ideas on this? ;-)

It's both unavoidable and correct from the C type system's
perspective, so there is nothing for pahole to warn about. We used to
have (for a long time) a similar clash with two completely different
ring_buffer structs. Eventually they just got renamed to avoid
duplication of related structs (task_struct and tons of other). But
both BTF dedup and CO-RE relocation algorithms are designed to handle
this correctly, so perhaps BTFIDS should be able to handle this as
well?

>
> easy fix is the patch below that renames the bcm's structs,
> it makes the kernel to compile.. but of course the new name
> is probably wrong and we should push this through that code
> authors

In this case, I think renaming generic device_private name is a good
thing regardless.

>
> jirka
>
>
> ---

[...]

Powered by blists - more mailing lists