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: <20100125181508.790010cb.akpm@linux-foundation.org>
Date:	Mon, 25 Jan 2010 18:15:08 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Ben Hutchings <bhutchings@...arflare.com>
Cc:	netdev@...r.kernel.org, bugzilla-daemon@...zilla.kernel.org,
	bugme-daemon@...zilla.kernel.org, michael@...fatt.org.nz,
	Alan Cox <alan@...rguk.ukuu.org.uk>, stable@...nel.org,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] starfire: Clean up properly if firmware loading fails

On Tue, 26 Jan 2010 02:02:12 +0000 Ben Hutchings <bhutchings@...arflare.com> wrote:

> netdev_open() will return without cleaning up net device or hardware
> state if firmware loading fails.  This results in a BUG() on a second
> attempt to bring the interface up, reported in
> <http://bugzilla.kernel.org/show_bug.cgi?id=15117>, and probably has
> even worse effects if the driver is removed afterwards.

(That's the wrong bugzilla URL)

> 
> Call netdev_close() to clean up on failure.

OK, thanks.

> ---
> On Mon, 2010-01-25 at 17:08 -0800, Andrew Morton wrote: 
> > (switched to email.  Please respond via emailed reply-to-all, not via the
> > bugzilla web interface).
> > 
> > On Wed, 20 Jan 2010 04:29:20 GMT
> > bugzilla-daemon@...zilla.kernel.org wrote:
> > 
> > > http://bugzilla.kernel.org/show_bug.cgi?id=15091
> > > 
> > >            Summary: starfire causes kernel BUG when interface goes up
> [...] 
> > > I formerly used 2.6.20 and 2.6.24 with a couple of starfire 4 port ethernet
> > > cards. On 2.6.32 the interfaces don't start on boot and when I issue "ifconfig
> > > ethX up" (where X is a starfire port).
> [...] 
> > Starfire is triggering the BUG_ON(!test_bit(NAPI_STATE_SCHED,
> > &n->state)); in napi_enable().
> > 
> > This is a regression somewhere between 2.6.24 and 2.6.32(!).
> 
> This driver now attempts to load firmware when an interface is brought
> up, *after* calling napi_enable().  If that fails, it will return
> without calling napi_disable().  On the second attempt to bring the
> interface it calls napi_enable() a second time and triggers this
> assertion.
> 
> As a workaround, try installing the necessary firmware. :-)
> 

Missing signed-off-by.  I added it, OK?  Also added a Cc:stable.


From: Ben Hutchings <bhutchings@...arflare.com>

netdev_open() will return without cleaning up net device or hardware state
if firmware loading fails.  This results in a BUG() on a second attempt to
bring the interface up, reported in
<http://bugzilla.kernel.org/show_bug.cgi?id=15117>, and probably has even
worse effects if the driver is removed afterwards.

Call netdev_close() to clean up on failure.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=15091

Signed-off-by: Ben Hutchings <bhutchings@...arflare.com>
Reported-by: Michael Moffatt <michael@...fatt.org.nz>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: <stable@...nel.org>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---

 drivers/net/starfire.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff -puN drivers/net/starfire.c~starfire-clean-up-properly-if-firmware-loading-fails drivers/net/starfire.c
--- a/drivers/net/starfire.c~starfire-clean-up-properly-if-firmware-loading-fails
+++ a/drivers/net/starfire.c
@@ -1063,7 +1063,7 @@ static int netdev_open(struct net_device
 	if (retval) {
 		printk(KERN_ERR "starfire: Failed to load firmware \"%s\"\n",
 		       FIRMWARE_RX);
-		return retval;
+		goto out_init;
 	}
 	if (fw_rx->size % 4) {
 		printk(KERN_ERR "starfire: bogus length %zu in \"%s\"\n",
@@ -1108,6 +1108,9 @@ out_tx:
 	release_firmware(fw_tx);
 out_rx:
 	release_firmware(fw_rx);
+out_init:
+	if (retval)
+		netdev_close(dev);
 	return retval;
 }
 
_



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ