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: <20100104184841.GA3106@del.dom.local>
Date:	Mon, 4 Jan 2010 19:48:41 +0100
From:	Jarek Poplawski <jarkao2@...il.com>
To:	Stephen Hemminger <shemminger@...tta.com>
Cc:	David Miller <davem@...emloft.net>,
	"Berck E. Nash" <flyboy@...il.com>,
	Mike McCormack <mikem@...g3k.org>, netdev@...r.kernel.org,
	dhazelton@...er.net, mbreuer@...jas.com
Subject: [PATCH v2] sky2: Fix oops in sky2_xmit_frame() after TX timeout

On Mon, Jan 04, 2010 at 10:26:37AM -0800, Stephen Hemminger wrote:
> > -	if (tx_avail(sky2) > MAX_SKB_TX_LE + 4)
> > +	/* Wake unless it's detached, and called e.g. from sky2_down() */
> > +	if (tx_avail(sky2) > MAX_SKB_TX_LE + 4 &&
> > +	    likely(netif_device_present(dev)))
> >  		netif_wake_queue(dev);
> >  }
> >
> 
> The likely() seems unnecessary noise here. It can't possibly matter that
> much.

OK. Thanks,
Jarek P.
------------> (take 2)

During TX timeout procedure dev could be awoken too early, e.g. by
sky2_complete_tx() called from sky2_down(). Then sky2_xmit_frame()
can run while buffers are freed causing an oops. This patch fixes it
by adding netif_device_present() test in sky2_tx_complete().

Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=14925

With debugging by: Mike McCormack <mikem@...g3k.org>

Reported-by: Berck E. Nash <flyboy@...il.com>
Tested-by: Berck E. Nash <flyboy@...il.com>
Signed-off-by: Jarek Poplawski <jarkao2@...il.com>

---

 drivers/net/sky2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 1c01b96..7650f73 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1844,7 +1844,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
 	sky2->tx_cons = idx;
 	smp_mb();
 
-	if (tx_avail(sky2) > MAX_SKB_TX_LE + 4)
+	/* Wake unless it's detached, and called e.g. from sky2_down() */
+	if (tx_avail(sky2) > MAX_SKB_TX_LE + 4 && netif_device_present(dev))
 		netif_wake_queue(dev);
 }
 
--
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