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: <1290528912.15453.3.camel@lb-tlvb-vladz>
Date:	Tue, 23 Nov 2010 18:15:12 +0200
From:	"Vladislav Zolotarov" <vladz@...adcom.com>
To:	"Dave Miller" <davem@...emloft.net>
cc:	"Eilon Greenstein" <eilong@...adcom.com>,
	"netdev list" <netdev@...r.kernel.org>
Subject: [PATCH net-next] bnx2x: Resolving a possible dead-lock
 situation

There is a possible dead-lock situation between sch_direct_xmit() 
(called from soft_IRQ context) and bnx2x_tx_int() when called from 
an ethtool self-test flow (syscall context).

To prevent a dead-lock, disable bottom-halves on a local CPU when taking
a tx_lock from bnx2x_tx_int() (use __netif_tx_lock_bh(txq)).

The flow in the bnx2x_tx_int() where tx_lock is taken should be hit
very rarely thus performance penalty of this change should be minimal.

Signed-off-by: Vladislav Zolotarov <vladz@...adcom.com>
Signed-off-by: Eilon Greenstein <eilong@...adcom.com>
---
 drivers/net/bnx2x/bnx2x_cmn.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index 94d5f59..5189788 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -144,14 +144,14 @@ int bnx2x_tx_int(struct bnx2x_fastpath *fp)
 		 * stops the queue
 		 */
 
-		__netif_tx_lock(txq, smp_processor_id());
+		__netif_tx_lock_bh(txq);
 
 		if ((netif_tx_queue_stopped(txq)) &&
 		    (bp->state == BNX2X_STATE_OPEN) &&
 		    (bnx2x_tx_avail(fp) >= MAX_SKB_FRAGS + 3))
 			netif_tx_wake_queue(txq);
 
-		__netif_tx_unlock(txq);
+		__netif_tx_unlock_bh(txq);
 	}
 	return 0;
 }
-- 
1.7.0.4




--
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