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  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:	Mon, 29 Sep 2014 14:04:55 +0300
From:	Amir Vadai <>
To:	"David S. Miller" <>
Cc:	Ido Shamay <>,,
	Yevgeny Petrilin <>,
	Or Gerlitz <>,
	Amir Vadai <>
Subject: [PATCH net] net/mlx4_en: mlx4_en_netpoll shouldn't call napi_schedule when port is down

From: Ido Shamay <>

mlx4_en_netpoll, which is mlx4_en ndo_poll_controller callback,
might be called when port is down, causing a napi_schedule when
napi->poll callback in NULL. mutex_trylock is needed to acquire
the port_state lock, since other threads may grab it and stop
the port while we are in napi scheduling. Using trylock since in atomic

Signed-off-by: Ido Shamay <>
Signed-off-by: Amir Vadai <>

Hi Dave,

Please push this commit to -stable


 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index abddcf8..e243f1c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1272,13 +1272,23 @@ out:
 static void mlx4_en_netpoll(struct net_device *dev)
 	struct mlx4_en_priv *priv = netdev_priv(dev);
+	struct mlx4_en_dev *mdev = priv->mdev;
 	struct mlx4_en_cq *cq;
 	int i;
+	if (!mutex_trylock(&mdev->state_lock))
+		return;
+	if (!priv->port_up)
+		goto out;
 	for (i = 0; i < priv->rx_ring_num; i++) {
 		cq = priv->rx_cq[i];
+	mutex_unlock(&mdev->state_lock);

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists