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]
Message-ID: <CAP01T77sC4czYEC6XX-qUs3a7aNy=GNjRR+t6Q8srTFrRSCpqQ@mail.gmail.com>
Date: Tue, 11 Mar 2025 15:40:37 +0100
From: Kumar Kartikeya Dwivedi <memxor@...il.com>
To: Venkat Rao Bagalkote <venkat88@...ux.ibm.com>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>, bpf <bpf@...r.kernel.org>, 
	LKML <linux-kernel@...r.kernel.org>, Hari Bathini <hbathini@...ux.ibm.com>, 
	Saket Kumar Bhaskar <skb99@...ux.ibm.com>, Alexei Starovoitov <ast@...nel.org>
Subject: Re: [bpf-next] selftests/bpf fails to compile

On Tue, 11 Mar 2025 at 15:12, Venkat Rao Bagalkote
<venkat88@...ux.ibm.com> wrote:
>
>
> On 10/03/25 2:15 pm, Alexei Starovoitov wrote:
> > On Mon, Mar 10, 2025 at 8:32 AM Venkat Rao Bagalkote
> > <venkat88@...ux.ibm.com> wrote:
> >> Greetings!!!
> >>
> >> selftests/bpf fails to compile with below error on bpf-next repo with
> >> commit head: f28214603dc6c09b3b5e67b1ebd5ca83ad943ce3
> >>
> >> Repo link:
> >> https://web.git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
> >>
> >> Reverting below commit resolves the issue.
> >>
> >> Commit ID: 48b3be8d7f82bea6affe6b9f11ee67380b55ede8
> > ...
> >
> >> If you happen to fix the issue, please add below tag.
> >>
> >> Reported-by: Venkat Rao Bagalkote <venkat88@...ux.ibm.com>
> > Not quite. The issue is likely that your llvm is too old.
> > Please upgrade.
>
>
> Thanks for the feedback.
>
> I did try the compilation on fedora41, with linux-mainline kernel and
> /sefltests/bpf compiled successfully. But on the same set-up
> /selftests/bpf failed to compile on bpf-next kernel.
>
>
> OS: Fedora Linux 41 (Server Edition)
> LLVM: llvm-19.1.7-3.fc41.ppc64le

After staring at the error log in disbelief, I guess I have the answer.
https://elixir.bootlin.com/linux/v6.13.6/source/arch/powerpc/include/asm/qspinlock_types.h#L8

PowerPC overrides the type such that lock->val is no longer atomic_t.
All of the bpf_atomic.h helpers assume it's atomic_t, hence they try
to do lock->val.counter which obviously fails with val is u32 instead
of a struct.

The "fix" would probably be to replace the usage of struct qspinlock
with our own definition copying the asm-generic qspinlock type.

I can send a patch later today in the evening, unless you beat me to it.

Thanks


>
> gcc version 14.2.1 20250110 (Red Hat 14.2.1-7) (GCC)
>
> Passing repo:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> Failing repo:
> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
>
> Regards,
>
> Venkat.
>
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ