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]
Date:	Tue, 12 Dec 2006 17:20:42 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Linus Torvalds <torvalds@...l.org>
Cc:	Andrew Morton <akpm@...l.org>,
	"David S. Miller" <davem@...emloft.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [patch] netpoll: fix netpoll lockup


* Linus Torvalds <torvalds@...l.org> wrote:

> On Tue, 12 Dec 2006, Ingo Molnar wrote:
> > 
> > current -git doesnt boot on my laptop due to the following netpoll 
> > breakages:
> > 
> >  - unlock the tx lock in the else branch too ...
> >  - use irq-safe locking instead of bh-safe locking, netpoll is
> >    often called from irq context.
> 
> This one doesn't apply for me any more, probably because David checked 
> in the patch from Andrew that fixed at least _part_ of the problem.
> 
> Davem, Ingo, Herbert, can you verify whether the fixes in the current 
> -git tree replace this patch from Ingo, or whether Ingo's patch is 
> still needed and just needs to be refreshed.

the first half of it is still needed - find the delta patch ontop of 
current -git below.

	Ingo

------------------------>
Subject: [patch] netpoll: fix netpoll lockup
From: Ingo Molnar <mingo@...e.hu>

current -git doesnt boot on my laptop due to netpoll
not unlocking the tx lock in the else branch.

booted this up on my laptop with lockdep enabled and there are
no locking complaints and it works fine.

Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 net/core/netpoll.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: linux-hres-timers.q/net/core/netpoll.c
===================================================================
--- linux-hres-timers.q.orig/net/core/netpoll.c
+++ linux-hres-timers.q/net/core/netpoll.c
@@ -55,6 +55,7 @@ static void queue_process(struct work_st
 	struct netpoll_info *npinfo =
 		container_of(work, struct netpoll_info, tx_work.work);
 	struct sk_buff *skb;
+	unsigned long flags;
 
 	while ((skb = skb_dequeue(&npinfo->txq))) {
 		struct net_device *dev = skb->dev;
@@ -64,15 +65,19 @@ static void queue_process(struct work_st
 			continue;
 		}
 
-		netif_tx_lock_bh(dev);
+		local_irq_save(flags);
+		netif_tx_lock(dev);
 		if (netif_queue_stopped(dev) ||
 		    dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) {
 			skb_queue_head(&npinfo->txq, skb);
-			netif_tx_unlock_bh(dev);
+			netif_tx_unlock(dev);
+			local_irq_restore(flags);
 
 			schedule_delayed_work(&npinfo->tx_work, HZ/10);
 			return;
 		}
+		netif_tx_unlock(dev);
+		local_irq_restore(flags);
 	}
 }
 
-
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