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
| ||
|
Date: Thu, 5 Sep 2013 14:23:25 +0100 From: Al Viro <viro@...IV.linux.org.uk> To: Miklos Szeredi <miklos@...redi.hu> Cc: Linux-Fsdevel <linux-fsdevel@...r.kernel.org>, Kernel Mailing List <linux-kernel@...r.kernel.org>, "mszeredi@...e.cz" <mszeredi@...e.cz>, David Howells <dhowells@...hat.com>, Steven Whitehouse <swhiteho@...hat.com>, Trond Myklebust <Trond.Myklebust@...app.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org> Subject: Re: [PATCH 04/11] vfs: check unlinked ancestors before mount On Thu, Sep 05, 2013 at 02:39:11PM +0200, Miklos Szeredi wrote: > +static bool __has_unlinked_ancestor(struct dentry *dentry) > +{ > + struct dentry *this; > + > + for (this = dentry; !IS_ROOT(this); this = this->d_parent) { > + int is_unhashed; > + > + /* Need exclusion wrt. check_submounts_and_drop() */ > + spin_lock(&this->d_lock); > + is_unhashed = d_unhashed(this); > + spin_unlock(&this->d_lock); > + > + if (is_unhashed) > + return true; > + } > + return false; > +} I still don't get it; why do you need to bother with early setting of DCACHE_MOUNTED? You are grabbing rename_lock for write in d_set_mounted(). What kind of races with check for submounts are you worried about? d_walk() will rescan everything if something grabs rename_lock for write while it had been running, so just fold the "have nothing in d_subdir" case of check_submounts_and_drop() into d_walk() and be done with that... What's the problem with such variant? AFAICS, all you need to care about is d_set_mounted() not getting between the scan for submounts and actual __d_drop() and your "finish" callback is called only after d_walk() having grabbed d_lock *and* rechecked rename_lock. -- 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