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: <1284148323.19890.94.camel@haakon2.linux-iscsi.org>
Date:	Fri, 10 Sep 2010 12:52:03 -0700
From:	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>
To:	Joel Becker <Joel.Becker@...cle.com>
Cc:	Konrad Rzeszutek Wilk <konrad@...nok.org>,
	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>,
	Linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [RFC 02/22] configfs: Add struct
	configfs_item_operations->check_link() in configfs_unlink()

On Fri, 2010-09-10 at 12:44 -0700, Joel Becker wrote:
> On Fri, Sep 10, 2010 at 12:06:46PM -0700, Nicholas A. Bellinger wrote:
> > On Fri, 2010-09-10 at 08:28 -0700, Joel Becker wrote:
> > > 	The trivial solution is to refcount your ACLs.  You get both
> > > allow_link() calls, so you should be able to increment a counter there,
> > > and then drop them when the last drop_link() call is made.  That will
> > > keep your consumer structures around until all links are exhausted.
> > > 
> > 
> > So I am a bit confused wrt to this last response..  The ->check_link()
> > patch and it's use in the fabric independent code within
> > target_core_fabric_configfs.c does exactly this for the 'MappedLUN'
> > symlink case, eg: requires the consumer to do the allow_link() +
> > drop_link() refcounting, and add the
> > API check into fs/configfs/symlink.c:configfs_unlink()
> 
> 	You can refcount without check_link().

So what do you recommend here..?

>  
> > Is there another form of configfs consumer refcounting that you had in
> > mind beyond using an atomic_t for this with ->check_link() here..?
> 
> 	I'm saying that you won't crash if you don't free the ACLs on
> the first drop_link().  That is, the drop_link() goes through as
> configfs wants it to, but you don't crash.

The problem is that the 'unlink sub_child/group1/src_0/src_link' can't
signal to the other struct config_group to also call an internal 'unlink
sub_child/group2/dst_0/dst_link' to drop the child link outside of it's
struct config_group.

> 
> > So beyond a configfs consumer solution, what do you think about checking
> > for the sub_child/group2/dst_0/dst_link style of symlink
> > in fs/configfs/symlink.c:configfs_symlink() in order to add some form of
> > internal refcount when the symlink source is within the same consumer
> > LKM, but outside of the parent struct config_group..?
> > 
> > This would involve the conversion of fs/configfs/symlink.c:
> > configfs_unlink() path to check for the existence of this internal
> > refcount and returning -EPERM when any sub_child/group2/dst_0/dst_link
> > exist when 'unlink sub_child/group1/src_0/src_link' is attempted.
> 
> 	You're still fighting allowing the links to go away.  You
> haven't explained why that is necessary.  You had a problem with a crash
> because you expected one reference to your ACLs and actually have two,
> but you can fix that without modifying configfs.

If this is the case then I must be mis-understanding what you mean by
configfs consumer refcounting from allow_link() and drop_link().  Can
you give me a bit more detail where I should be looking..?

Thanks!

--nab


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