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]
Message-Id: <200707120119.12589.arnd@arndb.de>
Date:	Thu, 12 Jul 2007 01:19:11 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Linas Vepstas <linas@...tin.ibm.com>
Cc:	cbe-oss-dev@...abs.org, netdev@...r.kernel.org,
	Christian Krafft <krafft@...ibm.com>
Subject: [PATCH] spidernet: enable poll() before registering interrupts

We must not call netif_poll_enable after enabling interrupts,
because an interrupt might come in and set the __LINK_STATE_RX_SCHED
bit before we get to clear that bit again. If that happens,
the next call to the ->poll() function will oops.

Signed-off-by: Arnd Bergmann <arnd.bergmann@...ibm.com>
---
This was found during testing with the fedora kernel,
with all patches from netdev-2.6.git applied.

It may not be the right fix, but this is currently the
only way I can get that kernel to boot.

One part I don't understand at the moment is that Christian
Krafft reported the same problem with tg3, but that driver
has all interrupts disabled at the device while calling
the request_irq() function, which seems to be the best
solution for avoiding the bug in the first place.

Index: linux-2.6/drivers/net/spider_net.c
===================================================================
--- linux-2.6.orig/drivers/net/spider_net.c
+++ linux-2.6/drivers/net/spider_net.c
@@ -1997,6 +1997,7 @@ spider_net_open(struct net_device *netde
 	/* further enhancement: setup hw vlan, if needed */
 
 	result = -EBUSY;
+	netif_poll_enable(netdev);
 	if (request_irq(netdev->irq, spider_net_interrupt,
 			     IRQF_SHARED, netdev->name, netdev))
 		goto register_int_failed;
@@ -2005,11 +2006,11 @@ spider_net_open(struct net_device *netde
 
 	netif_start_queue(netdev);
 	netif_carrier_on(netdev);
-	netif_poll_enable(netdev);
 
 	return 0;
 
 register_int_failed:
+	netif_poll_disable(netdev);
 	spider_net_free_rx_chain_contents(card);
 alloc_skbs_failed:
 	spider_net_free_chain(card, &card->rx_chain);
-
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