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: <20081218114851.GT19128@hawkmoon.kerlabs.com>
Date:	Thu, 18 Dec 2008 12:48:51 +0100
From:	Louis Rilling <Louis.Rilling@...labs.com>
To:	Steven Whitehouse <swhiteho@...hat.com>
Cc:	Joel Becker <Joel.Becker@...cle.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, cluster-devel@...hat.com
Subject: Re: [PATCH] configfs: Silence lockdep on mkdir(), rmdir() and
	configfs_depend_item()

On 18/12/08 11:26 +0000, Steven Whitehouse wrote:
> On Thu, 2008-12-18 at 01:27 -0800, Joel Becker wrote:
> > 
> > 	It's about the default_groups and how they build up and tear
> > down small bits of tree.
> > 	A simple creation of a config_item, a mkdir(2), is a normal VFS
> > lock set and doesn't make lockdep unhappy.  But if the new config_item
> > has a default_group or two, they need locking too.  Not so much on
> > mkdir(2), but on rmdir(2).
> > 
> So if I've understood this correctly, the dentries created upon mkdir
> live until such time as they are removed at some later date, presumably
> with rmdir?
> 
> When creating the tree, would it be possible to build it starting from
> the bottom and working towards the point of attachment and then to not
> actually attach it until the last moment? That way it would not be
> visible from userland until it was linked into the existing dir and that
> solves the locking issue for mkdir I think.
> 
> As you say, rmdir seems the harder problem, but again, is it possible to
> separate the unlink operation from the destruction of the tree by
> keeping the tree, after its been unlinked, until the last userland
> reference has gone away? At least I assume that is why the locking is
> there. I may be a bit off the mark, but it seems like this is quite
> similar to how the VFS does umount, so maybe there are some hints in
> that code which may help us solve this issue?

I second this kind of rework and even think that it is doable. This would avoid
exposing things to userspace before they are created for sure. I even had to
include dirty hacks in configfs to avoid exposing too much of such temporary
things, and I'm definitely not proud of this.
Unfortunately I don't have time to rework configfs this way at all.

Louis

-- 
Dr Louis Rilling			Kerlabs
Skype: louis.rilling			Batiment Germanium
Phone: (+33|0) 6 80 89 08 23		80 avenue des Buttes de Coesmes
http://www.kerlabs.com/			35700 Rennes

Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ