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>] [day] [month] [year] [list]
Date:	Fri, 4 Sep 2015 22:46:32 +0000
From:	Anish Bhatt <anish@...lsio.com>
To:	Nicholas Krause <xerofoify@...il.com>,
	"JBottomley@...n.com" <JBottomley@...n.com>
CC:	"hare@...e.de" <hare@...e.de>,
	"michaelc@...wisc.edu" <michaelc@...wisc.edu>,
	"davem@...emloft.net" <davem@...emloft.net>,
	Hariprasad S <hariprasad@...lsio.com>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] csiostor:Fix locking requirements for function call in
 the function csio_alloc_rnode

> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@...il.com]
> Sent: Thursday, September 3, 2015 10:44 AM
> To: JBottomley@...n.com
> Cc: hare@...e.de; michaelc@...wisc.edu; davem@...emloft.net; Anish
> Bhatt; Hariprasad S; linux-scsi@...r.kernel.org; linux-
> kernel@...r.kernel.org
> Subject: [PATCH] csiostor:Fix locking requirements for function call in the
> function csio_alloc_rnode
> 
> This fixes locking requirements for the function call to the function
> csio_rnode_init to properly lock and disable irqs before calling this function
> with spin_lock_irq on the structure pointer hw of type csio_hw and unlocking
> after the function call with spin_unlock_irq in order to prevent concurrent
> access on the shared structure pointer hw of type csio_hw with other
> threads of execution accessing this structure
> 
> Signed-off-by: Nicholas Krause <xerofoify@...il.com>
> ---
>  drivers/scsi/csiostor/csio_rnode.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/csiostor/csio_rnode.c
> b/drivers/scsi/csiostor/csio_rnode.c
> index e9c3b04..85635f4 100644
> --- a/drivers/scsi/csiostor/csio_rnode.c
> +++ b/drivers/scsi/csiostor/csio_rnode.c
> @@ -222,9 +222,13 @@ csio_alloc_rnode(struct csio_lnode *ln)
>  		goto err;
> 
>  	memset(rn, 0, sizeof(struct csio_rnode));
> -	if (csio_rnode_init(rn, ln))
> +	spin_lock_irq(&hw->lock);
> +	if (csio_rnode_init(rn, ln)) {
> +		spin_unlock_irq(&hw->lock);
>  		goto err_free;
> -
> +	}
> +
> +	spin_unlock_irq(&hw->lock);
>  	CSIO_INC_STATS(ln, n_rnode_alloc);
> 
>  	return rn;
> --
> 2.1.4

NACK. Function called from csio_fcoe_fwevt_handler() with lock held.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ