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: <4142781.4gMiS9Brv9@wuerfel>
Date:   Mon, 24 Oct 2016 21:42:36 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Michal Hocko <mhocko@...nel.org>
Cc:     Hugh Dickins <hughd@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Andreas Gruenbacher <agruenba@...hat.com>,
        Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] shmem: avoid maybe-uninitialized warning

On Monday, October 24, 2016 6:22:44 PM CEST Michal Hocko wrote:
> On Mon 24-10-16 17:25:03, Arnd Bergmann wrote:
> > After enabling -Wmaybe-uninitialized warnings, we get a false-postive
> > warning for shmem:
> > 
> > mm/shmem.c: In function ‘shmem_getpage_gfp’:
> > include/linux/spinlock.h:332:21: error: ‘info’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> Is this really a false positive? If we goto clear and then 
>         if (sgp <= SGP_CACHE &&
>             ((loff_t)index << PAGE_SHIFT) >= i_size_read(inode)) {
>                 if (alloced) {
> 
> we could really take a spinlock on an unitialized variable. But maybe
> there is something that prevents from that...

I did the patch a few weeks ago (I sent the more important
ones out first) and I think I concluded then that 'alloced'
would be false in that case.

> Anyway the whole shmem_getpage_gfp is really hard to follow due to gotos
> and labels proliferation.

Exactly. Maybe we should mark the patch for -stable backports after all
just to be sure.

Andreas also pointed out on IRC that there is another assignment
that can be removed in the function when the variable is initialized
upfront, so I'll resend anyway.

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ