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:   Wed, 26 Oct 2022 09:39:01 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Gautam Menghani <gautammenghani201@...il.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Tom Rix <trix@...hat.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
        patches@...ts.linux.dev, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] mm/khugepaged: Initialize index and nr in collapse_file()

On Tue, Oct 25, 2022 at 06:48:02PM -0700, Andrew Morton wrote:
> On Tue, 25 Oct 2022 10:34:07 -0700 Nathan Chancellor <nathan@...nel.org> wrote:
> 
> > Clang warns (trimmed for brevity):
> > 
> >   mm/khugepaged.c:1729:7: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> >   mm/khugepaged.c:1716:6: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> >   mm/khugepaged.c:1729:7: warning: variable 'nr' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> >   mm/khugepaged.c:1716:6: warning: variable 'nr' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> > 
> > There are two goto statements that will use index and nr before they
> > have been properly initialized. Zero initialize them so that they can be
> > safely used by the tracepoint at the end of the function.
> 
> Thanks.  I've actually dropped the offending patch - I'd like a resend
> which includes a fix such as this and a good reason for making the
> change.

That certainly seems like a reasonable request. Thanks for letting me
know!

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ