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]
Date:	Sun, 5 Sep 2010 22:08:16 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>
Cc:	linux-scsi <linux-scsi@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	Mike Christie <michaelc@...wisc.edu>,
	Christoph Hellwig <hch@....de>, Hannes Reinecke <hare@...e.de>,
	James Bottomley <James.Bottomley@...e.de>,
	Jens Axboe <axboe@...nel.dk>,
	Boaz Harrosh <bharrosh@...asas.com>, Greg KH <gregkh@...e.de>
Subject: Re: [RFC 22/22] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric
 module

On Sun, Sep 05, 2010 at 02:51:19PM -0700, Nicholas A. Bellinger wrote:
> On Sun, 2010-09-05 at 13:30 -0700, Dmitry Torokhov wrote:
> > On Mon, Aug 30, 2010 at 02:23:23AM -0700, Nicholas A. Bellinger wrote:
> > > +
> > > +static void tcm_loop_primary_release(struct device *dev)
> > > +{
> > > +	return;
> > > +}
> > > +
> > > +static struct device tcm_loop_primary = {
> > > +	.init_name		= "tcm_loop_0",
> > > +	.release		= tcm_loop_primary_release,
> > > +};
> > > +
> > 
> > No, you can not have statically allocated devices and dummy release
> > functions.
> > 
> 
> Last time I checked this is still what mainline
> drivers/scsi/scsi_debug.c is doing for struct device pseudo_primary:
> 
> static void pseudo_0_release(struct device *dev)
> {
>         if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
>                 printk(KERN_INFO "scsi_debug: pseudo_0_release() called\n");
> }
> 
> static struct device pseudo_primary = {
>         .init_name      = "pseudo_0",
>         .release        = pseudo_0_release,
> };
> 
> so for these type of things in TCM_Loop I tend to follow what scsi_debug does,
>  so I don't exactly see a issue here atm.  Anybody else have comments..?

The kobject embedded in the device structure is refcounted and it's
lifetime may be different from lifetime of your module. If somebody
happen to hold reference to the driver while your module is being
unloaded bad things will happen.

I am sure Greg has something on this topic ready for cut-and-paste.

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