From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:46706 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbeJMNmQ (ORCPT ); Sat, 13 Oct 2018 09:42:16 -0400 Date: Sat, 13 Oct 2018 07:06:19 +0100 From: Al Viro To: David Howells Cc: "Eric W. Biederman" , Alan Jenkins , torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, mszeredi@redhat.com Subject: Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12] Message-ID: <20181013060618.GQ32577@ZenIV.linux.org.uk> References: <87sh1cqqfs.fsf@xmission.com> <5c6f3d62-4cec-2aea-4693-62928611c526@gmail.com> <153754740781.17872.7869536526927736855.stgit@warthog.procyon.org.uk> <153754743491.17872.12115848333103740766.stgit@warthog.procyon.org.uk> <862e36a2-2a6f-4e26-3228-8cab4b4cf230@gmail.com> <17405.1539272035@warthog.procyon.org.uk> <15324.1539289074@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15324.1539289074@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Oct 11, 2018 at 09:17:54PM +0100, David Howells wrote: > +/* > + * Object if there are any nsfs mounts in the specified subtree. These can act > + * as pins for mount namespaces that aren't checked by the mount-cycle checking > + * code, thereby allowing cycles to be made. > + */ > +static bool check_for_nsfs_mounts(struct mount *subtree) > +{ > + struct mount *p; > + bool ret = false; > + > + lock_mount_hash(); > + for (p = subtree; p; p = next_mnt(p, subtree)) > + if (mnt_ns_loop(p->mnt.mnt_root)) > + goto out; > + > + ret = true; > +out: > + unlock_mount_hash(); > + return ret; > +} Umm... The comment doesn't match the behaviour - you are accepting references to later namespaces. Behaviour is not a problem, the comment is.