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:	Fri, 26 Feb 2016 14:54:49 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	linux-arm-kernel@...ts.infradead.org
Cc:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org,
	Russ Gorby <richardx.r.gorby@...el.com>,
	linux-serial@...r.kernel.org, Jiri Slaby <jslaby@...e.com>,
	Alan Cox <alan@...ux.intel.com>
Subject: Re: [PATCH] serial: ifx6x60: avoid uninitialized variable use

On Friday 26 February 2016 00:06:51 One Thousand Gnomes wrote:
> On Thu, 25 Feb 2016 21:47:57 +0100
> Arnd Bergmann <arnd@...db.de> wrote:
> 
> > gcc warns about a potential use of an uninitialized variable in this driver:
> > 
> > drivers/tty/serial/ifx6x60.c: In function 'ifx_spi_complete':
> > drivers/tty/serial/ifx6x60.c:713:6: warning: 'more' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >    if (more || ifx_dev->spi_more || queue_length > 0 ||
> > 
> > Unlike a lot of other such warnings, this one is correct and describes
> > an actual problem in the handling of the "IFX_SPI_HEADER_F" result code.
> > 
> > This appears to be a result from a restructuring of the driver that
> > dates back to before it was merged in the kernel, so it's impossible
> > to know where it went wrong. I also don't know what that result code
> > means, so I have no idea if setting 'more' to zero is the correct
> > solution, but at least it makes the behavior reproducible rather than
> > depending on whatever happens to be on the kernel stack.
> 
> Would it not be far simpler just to set more = 0 at the top of
> ifx_spi_complete ?
> 
> 

That would be simpler, but I generally don't like to do that, because it
makes it less obvious where the value is coming from.

In this case, it's still not obvious, as I was just guessing what the
original intention might have been.

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ