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]
Date: Mon, 1 Apr 2024 21:16:22 +0200
From: Uros Bizjak <ubizjak@...il.com>
To: Charlemagne Lasse <charlemagnelasse@...il.com>
Cc: x86@...nel.org, LKML <linux-kernel@...r.kernel.org>, 
	Luc Van Oostenryck <lucvoo@...nel.org>, Andy Lutomirski <luto@...nel.org>, Ingo Molnar <mingo@...nel.org>, 
	Nadav Amit <namit@...are.com>, Brian Gerst <brgerst@...il.com>, 
	Denys Vlasenko <dvlasenk@...hat.com>, "H . Peter Anvin" <hpa@...or.com>, 
	Linus Torvalds <torvalds@...ux-foundation.org>, Peter Zijlstra <peterz@...radead.org>, 
	Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>, Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: warning: cast removes address space '__percpu' of expression

On Sat, Mar 30, 2024 at 12:57 AM Charlemagne Lasse
<charlemagnelasse@...il.com> wrote:
>
> After switching to linux 6.9-rc1, I get a lot of these errors (when
> compiling with cgcc/sparse):
>
> ./include/linux/netdevice.h:4033:17: warning: cast removes address
> space '__percpu' of expression
>
> This is around code which wasn't changed and which correctly uses the
> per cpu helper. Sparse flags were -Wsparse-all for sparse 0.6.4
> (latest release). Sparse was enabled via C=1 parameter and sparse was
> configured using CHECK="sparse -Wsparse-all"
>
> Problem was introduced between commit 8ae292c66dcb ("x86/lib: Address
> kernel-doc warnings") and 3a1d3829e193 ("x86/percpu: Avoid sparse
> warning with cast to named address space").
>
> I would even go as far as saying that 1ca3683cc6d2 ("x86/percpu:
> Enable named address spaces with known compiler version") together
> with 3a1d3829e193 ("x86/percpu: Avoid sparse warning with cast to
> named address space") triggered this problem

Are you sure this is the offending commit?

The complexity of x86 low-level code forced the whole x86 percpu
rewrite to be designed and written in such a way that it can be
disabled in a single place. So, using the attached patch will switch
x86 percpu functionality back to the previous implementation - and I
get the same warnings from the old implementation as when new named
address spaces are enabled:

security/selinux/netif.c: note: in included file:
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression
/include/linux/netdevice.h:4041:17: warning: cast removes address
space '__percpu' of expression

4037 static inline void __dev_put(struct net_device *dev)
4038 {
4039         if (dev) {
4040 #ifdef CONFIG_PCPU_DEV_REFCNT
4041                 this_cpu_dec(*dev->pcpu_refcnt);
4042 #else
4043                 refcount_dec(&dev->dev_refcnt);
4044 #endif
4045         }
4046 }

Uros.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ