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:   Mon, 17 Oct 2016 14:13:17 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     Dave Chinner <david@...morbit.com>,
        "Darrick J. Wong" <darrick.wong@...cle.com>,
        linux-xfs@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] xfs: Fix uninitialized variable in xfs_reflink_reserve_cow_range()

Hi Christoph,

On Mon, Oct 17, 2016 at 2:08 PM, Christoph Hellwig <hch@...radead.org> wrote:
> On Mon, Oct 17, 2016 at 12:16:44PM +0200, Geert Uytterhoeven wrote:
>> with gcc 4.1.2:
>>
>>     fs/xfs/xfs_reflink.c: In function ‘xfs_reflink_reserve_cow_range’:
>>     fs/xfs/xfs_reflink.c:327: warning: ‘error’ may be used uninitialized in this function
>>
>> Indeed, if "count" is zero, the function will return an uninitialized
>> error value.
>>
>> While "count" is unlikely to be zero, this function is called through
>> the public iomap API. Hence fix this by preinitializing error to zero.
>
> The iomap API should never call in with a zero count, but I think the
> initialization is a fine safety net anyway:

Exactly my thought.

> Reviewed-by: Christoph Hellwig <hch@....de>

Thanks!

> Btw, what compiler did you get this from?  I haven't seen it, but then
> again I recently missed a lot of initializers without compiler warnings,
> so either something changed in the Debian stable gcc or our build
> system recently..

m68k-linux-gnu-gcc version 4.1.2 20061115 (prerelease) (Ubuntu 4.1.1-21)

Stoneage, but it did find 4 real bugs introduced in v4.9-rc1...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ