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-next>] [day] [month] [year] [list]
Date:	Tue, 29 May 2007 23:14:58 +0200
From:	Francois Romieu <romieu@...zoreil.com>
To:	Gary Zambrano <zambrano@...adcom.com>
Cc:	jgarzik@...ox.com, akpm@...ux-foundation.org,
	netdev@...r.kernel.org
Subject: [PATCH] b44: netpoll locking fix

The irq handling thread (b44_interrupt) uses the same lock as the NAPI
thread. This change should prevent a deadlock if something interrupts
the b44 NAPI thread and tries to printk through netconsole.

Signed-off-by: Francois Romieu <romieu@...zoreil.com>
---
 drivers/net/b44.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 879a2ff..64d75e4 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -853,16 +853,18 @@ static int b44_rx(struct b44 *bp, int budget)
 static int b44_poll(struct net_device *netdev, int *budget)
 {
 	struct b44 *bp = netdev_priv(netdev);
+	unsigned long flags;
 	int done;
 
-	spin_lock_irq(&bp->lock);
+	spin_lock_irqsave(&bp->lock, flags);
 
 	if (bp->istat & (ISTAT_TX | ISTAT_TO)) {
 		/* spin_lock(&bp->tx_lock); */
 		b44_tx(bp);
 		/* spin_unlock(&bp->tx_lock); */
 	}
-	spin_unlock_irq(&bp->lock);
+
+	spin_unlock_irqrestore(&bp->lock, flags);
 
 	done = 1;
 	if (bp->istat & ISTAT_RX) {
@@ -882,8 +884,6 @@ static int b44_poll(struct net_device *netdev, int *budget)
 	}
 
 	if (bp->istat & ISTAT_ERRORS) {
-		unsigned long flags;
-
 		spin_lock_irqsave(&bp->lock, flags);
 		b44_halt(bp);
 		b44_init_rings(bp);
-- 
1.5.2

-
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