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-next>] [day] [month] [year] [list]
Message-ID: <20100917043401.GD8926@ram-laptop>
Date:	Thu, 16 Sep 2010 21:34:01 -0700
From:	Ram Pai <linuxram@...ibm.com>
To:	Valerie Aurora <vaurora@...hat.com>
Cc:	Ram Pai <ram.n.pai@...il.com>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Miklos Szeredi <miklos@...redi.hu>,
	Christoph Hellwig <hch@...radead.org>,
	Andreas Gruenbacher <agruen@...e.de>,
	Nick Piggin <npiggin@...nel.dk>, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 03/34] VFS: Add CL_NO_SLAVE flag to
 clone_mnt()/copy_tree()

On Thu, Sep 16, 2010 at 05:09:58PM -0700, Ram Pai wrote:
> On Thu, Sep 16, 2010 at 3:11 PM, Valerie Aurora <vaurora@...hat.com> wrote:
> 
> > Passing the CL_NO_SLAVE flag to clone_mnt() causes the clone
> > to fail if the source mnt is a slave.
> >
> > Signed-off-by: Valerie Aurora <vaurora@...hat.com>
> > ---
> >  fs/namespace.c |    3 +++
> >  fs/pnode.h     |    1 +
> >  2 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/fs/namespace.c b/fs/namespace.c
> > index eeb4c22..6956062 100644
> > --- a/fs/namespace.c
> > +++ b/fs/namespace.c
> > @@ -565,6 +565,9 @@ static struct vfsmount *clone_mnt(struct vfsmount *old,
> > struct dentry *root,
> >        if ((flag & CL_NO_SHARED) && (IS_MNT_SHARED(old)))
> >                return ERR_PTR(-EINVAL);
> >
> > +       if ((flag & CL_NO_SLAVE) && (IS_MNT_SLAVE(old)))
> > +               return ERR_PTR(-EINVAL);
> > +
> >
> 
> 
> its been a while and my memory may have corroded.  But I dont think this
> check is needed. Because cloning a 'slave mount' makes the mount a 'private
> mount' and not a 'slave mount'.

There is one case where a 'slave mount' when cloned can generate a 'slave mount', and
that is when the 'slave mount' is also a 'shared mount'. So the above check has to
be

       if ((flag & CL_NO_SLAVE) && (IS_MNT_SLAVE(old) && IS_MNT_SHARED(old)))
               return ERR_PTR(-EINVAL);

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