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]
Message-Id: <1461007188-1603-2-git-send-email-hannes@stressinduktion.org>
Date:	Mon, 18 Apr 2016 21:19:42 +0200
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	netdev@...r.kernel.org
Cc:	jesse@...nel.org, Sathya Perla <sathya.perla@...adcom.com>,
	Ajit Khaparde <ajit.khaparde@...adcom.com>,
	Padmanabh Ratnakar <padmanabh.ratnakar@...adcom.com>,
	Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>,
	Somnath Kotur <somnath.kotur@...adcom.com>
Subject: [PATCH net-next 1/7] benet: be_resume needs to protect be_open with rtnl_lock

be_open calls down to functions which expects rtnl lock to be held.

Cc: Sathya Perla <sathya.perla@...adcom.com>
Cc: Ajit Khaparde <ajit.khaparde@...adcom.com>
Cc: Padmanabh Ratnakar <padmanabh.ratnakar@...adcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>
Cc: Somnath Kotur <somnath.kotur@...adcom.com>
Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 536686476369bf..ed98ef1ecac38d 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4890,11 +4890,13 @@ static int be_resume(struct be_adapter *adapter)
 	if (status)
 		return status;
 
-	if (netif_running(netdev)) {
+	rtnl_lock();
+	if (netif_running(netdev))
 		status = be_open(netdev);
-		if (status)
-			return status;
-	}
+	rtnl_unlock();
+
+	if (status)
+		return status;
 
 	netif_device_attach(netdev);
 
-- 
2.5.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ