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]
Message-ID: <87ms2e32gw.ffs@tglx>
Date: Fri, 16 Jan 2026 00:01:19 +0100
From: Thomas Gleixner <tglx@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: kernel test robot <lkp@...el.com>, Ian Rogers <irogers@...gle.com>,
 oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
 x86@...nel.org, sparse@...isli.org, linux-sparse@...r.kernel.org, Marco
 Elver <elver@...gle.com>
Subject: Re: [tip:timers/vdso 12/14] net/rds/ib_cm.c:96:35: sparse: sparse:
 incorrect type in argument 1 (different modifiers)

On Thu, Jan 15 2026 at 22:11, Peter Zijlstra wrote:

> On Thu, Jan 15, 2026 at 08:28:51PM +0100, Thomas Gleixner wrote:
>> On Thu, Jan 15 2026 at 00:36, kernel test robot wrote:
>> 
>> Cc+ sparse folks.
>> 
>> > sparse warnings: (new ones prefixed by >>)
>> >>> net/rds/ib_cm.c:96:35: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
>> >    net/rds/ib_cm.c:96:35: sparse:     expected void *
>> >    net/rds/ib_cm.c:96:35: sparse:     got restricted __be64 const *
>> >    net/rds/ib_cm.c:103:27: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
>> >    net/rds/ib_cm.c:103:27: sparse:     expected void *
>> >    net/rds/ib_cm.c:103:27: sparse:     got restricted __be64 const *
>> 
>> After staring a while at it, it turns out that get_unaligned_t(), which
>> uses __unqual_scalar_typeof() to get an unqualified type makes sparse
>> unhappy when the data type is __be64 (or any other __beNN variant).
>> 
>> __beNN is annotated with __attribute__((bitwise)) when sparse is invoked
>> (#ifdef CHECKER). That allows sparse to detect incompatible math
>> operations with __beNN variables.
>> 
>
> Per:
>
>   https://git.kernel.org/pub/scm/devel/sparse/sparse-dev.git/commit/?id=dc9efe442b8949234a6599fdc94dc7221dd040e1
>
> it seems Sparse now knows about __typeof_unqual__; and it looks like the
> implementation does what you want here (although I've not tested it).
>
> Something like so perhaps, which then mandates the very latest Sparse.

I tried that before and sparse is still upset:

  net/rds/ib_cm.c:96:35: warning: incorrect type in argument 1 (different modifiers)
  net/rds/ib_cm.c:96:35:    expected void *
  net/rds/ib_cm.c:96:35:    got restricted __be64 const *
  net/rds/ib_cm.c:103:27: warning: incorrect type in argument 1 (different modifiers)
  net/rds/ib_cm.c:103:27:    expected void *
  net/rds/ib_cm.c:103:27:    got restricted __be64 const *

This time I looked deeper and it seems that USE_TYPEOF_UNQUAL is not
set.

If I force it to be set and use a proper compiler and top of tree
sparse, everything seems to be happy.

Figuring that out is something for tomorrow...

Thanks,

        tglx


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ