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]
Date:	Tue,  5 Apr 2016 17:19:03 -0400
From:	Bastien Philbert <bastienphilbert@...il.com>
To:	jejb@...ux.vnet.ibm.com
Cc:	martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] csiostor: Fix backwards locking in the function __csio_unreg_rnode

This fixes backwards locking in the function __csio_unreg_rnode to
properly lock before the call to the function csio_unreg_rnode and
not unlock with spin_unlock_irq as this would not allow the proper
protection for concurrent access on the shared csio_hw structure
pointer hw. In addition switch the locking after the critical region
function call to properly unlock instead with spin_unlock_irq on

Signed-off-by: Bastien Philbert <bastienphilbert@...il.com>
---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/csiostor/csio_rnode.c b/drivers/scsi/csiostor/csio_rnode.c
index e9c3b04..029a09e 100644
--- a/drivers/scsi/csiostor/csio_rnode.c
+++ b/drivers/scsi/csiostor/csio_rnode.c
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn)
 		ln->last_scan_ntgts--;
 	}
 
-	spin_unlock_irq(&hw->lock);
-	csio_unreg_rnode(rn);
 	spin_lock_irq(&hw->lock);
+	csio_unreg_rnode(rn);
+	spin_unlock_irq(&hw->lock);
 
 	/* Cleanup I/Os that were waiting for rnode to unregister */
 	if (cmpl)
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ