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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Feb 2023 23:15:23 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Chao Yu <chao@...nel.org>
Cc:     jaegeuk@...nel.org, ndesaulniers@...gle.com, trix@...hat.com,
        linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
        patches@...ts.linux.dev, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] f2fs: Fix type of single bit bitfield in f2fs_io_info

On Thu, Feb 02, 2023 at 02:13:18PM +0800, Chao Yu wrote:
> On 2023/2/2 0:40, Nathan Chancellor wrote:
> > Clang warns:
> > 
> >    ../fs/f2fs/data.c:995:17: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
> >            fio->submitted = 1;
> >                           ^ ~
> >    ../fs/f2fs/data.c:1011:15: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
> >                            fio->retry = 1;
> >                                       ^ ~
> > 
> >    ../fs/f2fs/segment.c:3320:16: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
> >                    fio->in_list = 1;
> >                                 ^ ~
> > 
> > There is not a bug here because the value of these fields is never
> > explicitly compared against (just whether it is zero or non-zero) but
> > it is easy to silence the warning by using an unsigned type to allow
> > an assignment of 0 or 1 without implicit conversion.
> 
> Nathan, thanks a lot for catching this, do you mind letting I merge this fix
> into original patch? as the original patch has not been upstreamed yet.

No worries, do whatever you need to! I just care that the problem gets
resolved one way or another :)

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ