[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f7bfbf89d2ac4b929637bbb25f749c96@AcuMS.aculab.com>
Date: Sat, 14 Dec 2024 21:07:20 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Paul Moore' <paul@...l-moore.com>,
Christian Göttsche <cgoettsche@...tendoof.de>, "Linus
Torvalds" <torvalds@...ux-foundation.org>
CC: Christian Göttsche <cgzones@...glemail.com>,
"Stephen Smalley" <stephen.smalley.work@...il.com>, Ondrej Mosnacek
<omosnace@...hat.com>, Nathan Chancellor <nathan@...nel.org>, "Nick
Desaulniers" <ndesaulniers@...gle.com>, Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, "selinux@...r.kernel.org"
<selinux@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "llvm@...ts.linux.dev" <llvm@...ts.linux.dev>
Subject: RE: [PATCH] selinux: use native iterator types
From: Paul Moore
> Sent: 11 December 2024 18:54
>
> On Nov 25, 2024 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgoettsche@...tendoof.de> wrote:
> >
> > Use types for iterators equal to the type of the to be compared values.
> >
> > Reported by clang:
> >
> > security/selinux/ss/sidtab.c:126:2: warning: comparison of integers of different signs: 'int'
> and 'unsigned long' [-Wsign-compare]
> > 126 | hash_for_each_rcu(sidtab->context_to_sid, i, entry, list) {
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ./include/linux/hashtable.h:139:51: note: expanded from macro 'hash_for_each_rcu'
> > 139 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\
> > | ~~~ ^ ~~~~~~~~~~~~~~~
> >
> > security/selinux/selinuxfs.c:1520:23: warning: comparison of integers of different signs: 'int'
> and 'unsigned int' [-Wsign-compare]
> > 1520 | for (cpu = *idx; cpu < nr_cpu_ids; ++cpu) {
> > | ~~~ ^ ~~~~~~~~~~
> >
> > security/selinux/hooks.c:412:16: warning: comparison of integers of different signs: 'int' and
> 'unsigned long' [-Wsign-compare]
> > 412 | for (i = 0; i < ARRAY_SIZE(tokens); i++) {
> > | ~ ^ ~~~~~~~~~~~~~~~~~~
Isn't this an example of why -Wsign-compare is entirely stupid and isn't enabled
in the normal kernel build?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists