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  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]
Date:	Thu, 6 Mar 2014 09:13:09 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Bjorn Helgaas' <>
CC:	"" <>,
	"" <>,
	"Florian Fainelli" <>
Subject: RE: [PATCH] phy: fix compiler array bounds warning on settings[]

From: Bjorn Helgaas
> I'm stumped.  phy_find_valid() is static and only called from one
> place.  The 'idx' argument is always the result of phy_find_setting(),
> which should always return something between 0 and
> ARRAY_SIZE(settings), so I don't see any way idx can be < 0.
> I stripped this down as far as I could; the resulting test code is at
> if anybody else wants to look at it.  I'm
> using gcc 4.8.x 20131105 (prerelease), with "-Warray-bounds -O2"
> flags.
> I hesitate to suspect a compiler bug, but it is very strange.  For
> example, in my test code, replacing "MAX_NUM_SETTINGS" with "2" gets
> rid of the warnings.  MAX_NUM_SETTINGS is known to be 2 at
> compile-time, so I don't know why this should make a difference.

I can't get an array bounds error from the gcc 4.8.1-10ubuntu9 at all.
Not even when I index the array with a constant 3.
I wonder if they compiled it out!


Powered by blists - more mailing lists