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:   Thu, 20 Oct 2022 08:26:40 +0300
From:   Kalle Valo <kvalo@...nel.org>
To:     "Jason A. Donenfeld" <Jason@...c4.com>
Cc:     kernel test robot <lkp@...el.com>,
        Tomislav Požega <pozega.tomislav@...il.com>,
        llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Daniel Golle <daniel@...rotopia.org>,
        linux-wireless@...r.kernel.org
Subject: Re: drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9439:15: warning: result of comparison of constant -7 with expression of type 'char' is always false

"Jason A. Donenfeld" <Jason@...c4.com> writes:

> On Wed, Oct 19, 2022 at 2:02 AM Jason A. Donenfeld <Jason@...c4.com> wrote:
>>
>> On Wed, Oct 19, 2022 at 1:59 AM Jason A. Donenfeld <Jason@...c4.com> wrote:
>> >
>> > On Wed, Oct 19, 2022 at 1:55 AM Kalle Valo <kvalo@...nel.org> wrote:
>> > >
>> > > + jason, linux-wireless
>> > >
>> > > kernel test robot <lkp@...el.com> writes:
>> > >
>> > > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> > > > head:   aae703b02f92bde9264366c545e87cec451de471
>> > > > commit: dab902fe1d29dc0fa1dccc8d13dc89ffbf633881 wifi: rt2x00: add TX
>> > > > LOFT calibration for MT7620
>> > > > date:   4 weeks ago
>> > > > config: arm64-allmodconfig
>> > > > compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project
>> > > > 791a7ae1ba3efd6bca96338e10ffde557ba83920)
>> > > > reproduce (this is a W=1 build):
>> > > >         wget
>> > > > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross
>> > > > -O ~/bin/make.cross
>> > > >         chmod +x ~/bin/make.cross
>> > > >         # install arm64 cross compiling tool for clang build
>> > > >         # apt-get install binutils-aarch64-linux-gnu
>> > > >         #
>> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dab902fe1d29dc0fa1dccc8d13dc89ffbf633881
>> > > >         git remote add linus
>> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> > > >         git fetch --no-tags linus master
>> > > >         git checkout dab902fe1d29dc0fa1dccc8d13dc89ffbf633881
>> > > >         # save the config file
>> > > >         mkdir build_dir && cp config build_dir/.config
>> > > >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1
>> > > > O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/amd/amdgpu/
>> > > > drivers/net/wireless/ralink/rt2x00/ drivers/staging/media/
>> > > >
>> > > > If you fix the issue, kindly add following tag where applicable
>> > > > | Reported-by: kernel test robot <lkp@...el.com>
>> > > >
>> > > > All warnings (new ones prefixed by >>):
>> > > >
>> > > >>> drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9439:15: warning:
>> > > >> result of comparison of constant -7 with expression of type 'char'
>> > > >> is always false [-Wtautological-constant-out-of-range-compare]
>> > > >            gerr = (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 : gerr;
>> > > >                    ~~~~ ^ ~~~~~
>> > > >    drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9443:15: warning: result of comparison of constant -31 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
>> > > >            perr = (perr < -0x1f) ? -0x1f : (perr > 0x1d) ? 0x1d : perr;
>> > > >                    ~~~~ ^ ~~~~~
>> > > >    2 warnings generated.
>> > >
>> > > I believe this patch should fix it:
>> > >
>> > > https://patchwork.kernel.org/project/linux-wireless/patch/20221018202734.140489-1-Jason@zx2c4.com/
>> > >
>> > > Jason, is my understanding correct?
>> >
>> > That's a different bug caused by the same pitfall: assuming char is
>> > signed. I'll send a patch for that function too.
>>
>>
>> Actually, maybe I should fix the whole file? Patch incoming.
>
> Okay here's a v2 that handles it driver-wide:
> https://lore.kernel.org/linux-wireless/20221019081417.3402284-1-Jason@zx2c4.com/
> (Might take a few minutes to hit lore.)

Great, thanks Jason.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

Powered by blists - more mailing lists