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: <201302152005.51575.arnd@arndb.de>
Date:	Fri, 15 Feb 2013 20:05:51 +0000
From:	Arnd Bergmann <arnd@...db.de>
To:	Greg KH <greg@...ah.com>
Cc:	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
	David Stevenson <david@...ncliff.com>
Subject: Re: linux-next: build warning after merge of the char-misc tree

On Friday 15 February 2013, Greg KH wrote:
> On Fri, Feb 15, 2013 at 04:26:57PM +1100, Stephen Rothwell wrote:
> > 
> > After merging the char-misc tree, today's linux-next build (x86_64
> > allmodconfig) produced this warning:
> > 
> > drivers/w1/slaves/w1_therm.c: In function 'w1_therm_read':
> > drivers/w1/slaves/w1_therm.c:245:15: warning: 'crc' may be used uninitialized in this function [-Wuninitialized]
> > 
> > Its a false positive, but it was introduced by commit 867ff9880d5d
> > ("w1_therm: Retries: remove old code add CRC")
> 
> I don't see that here with gcc 4.7.1, perhaps you need to upgrade your
> version of gcc to not show these false positives?

I have finally put the pieces of the puzzle together. I already knew
that some of these warnings only happen when building with -Os (even
in gcc-4.8), since gcc turns off the inlining at a point after it
determines that the variable might be used uninitialized but before
determining that it's actually isn't.

I think the best way forward is to disable this particular warning
when building with -Os (which is enabled in allyesconfig). A false
positive seems more harmful than a false negative here, because it
prompts people to add broken initializations. This patch indeed
makes the majority of the allyesconfig warnings on ARM go away.
For the regular defconfig builds, we are already mostly clean,
and those are built with -O2.

Signed-off-by: Arnd Bergmann <arnd@...db.de>

diff --git a/Makefile b/Makefile
index 0b4bf62..4d60d97 100644
--- a/Makefile
+++ b/Makefile
@@ -570,7 +570,7 @@ endif # $(dot-config)
 all: vmlinux
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS	+= -Os
+KBUILD_CFLAGS	+= -Os $(call cc-option,-Wno-maybe-uninitialized,)
 else
 KBUILD_CFLAGS	+= -O2
 endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ