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]
Date:   Fri, 1 Dec 2023 14:57:29 +0100
From:   Uros Bizjak <ubizjak@...il.com>
To:     kernel test robot <lkp@...el.com>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        x86@...nel.org, Ingo Molnar <mingo@...nel.org>,
        Nadav Amit <namit@...are.com>
Subject: Re: [tip:x86/percpu 12/12] arch/x86/include/asm/preempt.h:27:55:
 sparse: sparse: incompatible types for operation (&):

On Sun, Oct 8, 2023 at 2:43 AM kernel test robot <lkp@...el.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/percpu
> head:   ca4256348660cb2162668ec3d13d1f921d05374a
> commit: ca4256348660cb2162668ec3d13d1f921d05374a [12/12] x86/percpu: Use C for percpu read/write accessors
> config: x86_64-randconfig-122-20231007 (https://download.01.org/0day-ci/archive/20231008/202310080853.UhMe5iWa-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231008/202310080853.UhMe5iWa-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202310080853.UhMe5iWa-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
>    kernel/bpf/percpu_freelist.c: note: in included file (through arch/x86/include/asm/preempt.h, include/linux/preempt.h, include/linux/spinlock.h, ...):
>    arch/x86/include/asm/percpu.h:550:49: sparse: sparse: Expected ) at end of cast operator
>    arch/x86/include/asm/percpu.h:550:49: sparse: sparse: got __seg_gs
>    arch/x86/include/asm/percpu.h:564:33: sparse: sparse: Expected ) at end of cast operator
>    arch/x86/include/asm/percpu.h:564:33: sparse: sparse: got __seg_gs

sparse is too strict here. The following code is perfectly legal:

--cut here--
int __seg_gs foo;

int bar (int *pcp)
{
  return *(typeof (*pcp) __seg_gs *)(unsigned long)(pcp);
}
--cut here--

$ gcc -O2 -S -Wextra -Wall test.c
$
$ sparse test.c
test.c:1:14: error: Expected ; at end of declaration
test.c:1:14: error: got foo
test.c:5:26: error: Expected ) at end of cast operator
test.c:5:26: error: got __seg_gs
$

Uros.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ