From: Ram <linuxram@us.ibm.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: viro@parcelfarce.linux.theplanet.co.uk,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] namespace.c: fix bind mount from foreign namespace
Date: Mon, 16 May 2005 08:11:19 -0700 [thread overview]
Message-ID: <1116256279.4154.41.camel@localhost> (raw)
In-Reply-To: <E1DWprs-0005D1-00@dorka.pomaz.szeredi.hu>
On Fri, 2005-05-13 at 23:11, Miklos Szeredi wrote:
> (CC restored, because I think this is interesting to others as well)
>
> > > > I dont get it...
> > > >
> > > > do you agree that bind mounts accross namespaces should be disallowed?
> > >
> > > No. I think it's a useful feature. It's actually been discussed at
> > > length earlier, that it makes sense if the user can copy private
> > > mounts from one session to the other (or even automate this with pam,
> > > and a daemon). Why should they be disallowed?
> >
> > I understand that feature and the way to do it is through shared
> > subtrees.
>
> I agree fully, that shared subtrees would be very useful.
>
> > I am against a mount in one namespace being bind mounted in
> > another namespace(which Al Viro has implied in his mail).
>
> I'd rather not speculate on what Al Viro was thinking, it may have
> been just a misunderstanding.
Can somebody who know internals of Al Viro's thinking help here?
>
> > With shared subtree if a bind mount is done
> > in one namespace, the bind happens within the same namespace.
>
> Yes. But that's not fundamentally different from explicitly passing a
> mount (through a file descriptor) to a process in a different
> namespace, and allowing that process to bind mount it in it's native
> namespace.
>
> The end result can be exactly the same, only in the shared subtree
> case the binding is implicit, while in the other case it's explicit on
> both sides (which makes it perfectly secure even for unprivileged use)
>
> Please explain why you think it's wrong to be able to bind mount from
> a different namespace?
If It is allowed, the concept of namespaces itself becomes
nebulous. one could bind mount the root vfsmount of all the other
namespace in their own namespace and then it all becomes one big tree
with all the other namespaces as a subtree.
why would we need this feature? what extra advantage would this feature
provide us? Is the advantage of this feature already discussed in this
thread? (maybe i missed it).
>
> >
> > However the operation is mirrored to other namespaces
> > that has the same heridity link to this namespace.
> >
> > probably I can give an example:
> >
> > if namespace n1 has the following tree
> > v11
> > / \
> > v12 v13
> >
> > v1 is mark shared. (mount --make-shared v1) [ for simplicity I vxy
> > means yth vfsmount in xth namespace ]
> >
> > and than n2 is cloned out of n1, than in n2 we have
> > v21
> > / \
> > v22 v23
> >
> > now a bind mount in n1
> > mount --bind v12 v13
> >
> > will first change the tree in n1 as follows:
> >
> > v11
> > / \
> > v12 v13
> > \
> > v14
> > where v14 is a bind mount of v12
> >
> >
> > and than due to propogation the tree in n2 will also change to
> > v21
> > / \
> > v22 v23
> > \
> > v24
> > where v24 is a bind mount of v22
> >
> >
> > Essentially there is no cross-contamination, as well as it meets
> > the requirement of per-user-namespace.
>
> What do you mean by cross contamination?
A vfsmount in one namespace bound to a mountpoint in another
namespace.
RP
>
> Thanks,
> Miklos
next prev parent reply other threads:[~2005-05-16 7:11 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-13 10:44 [PATCH] namespace.c: fix bind mount from foreign namespace Miklos Szeredi
2005-05-13 16:49 ` Ram
2005-05-13 17:06 ` Al Viro
2005-05-13 17:17 ` Miklos Szeredi
2005-05-13 17:25 ` Al Viro
2005-05-13 17:34 ` Miklos Szeredi
2005-05-13 17:29 ` Ram
2005-05-13 18:40 ` Miklos Szeredi
[not found] ` <1116012287.6248.410.camel@localhost>
[not found] ` <E1DWfqJ-0004eP-00@dorka.pomaz.szeredi.hu>
[not found] ` <1116013840.6248.429.camel@localhost>
2005-05-14 6:11 ` Miklos Szeredi
2005-05-16 15:11 ` Ram [this message]
2005-05-16 8:44 ` Miklos Szeredi
2005-05-16 8:59 ` Miklos Szeredi
2005-05-16 11:26 ` Jamie Lokier
2005-05-16 13:23 ` Miklos Szeredi
2005-05-16 11:14 ` Jamie Lokier
2005-05-17 3:50 ` Ram
2005-05-16 20:15 ` Miklos Szeredi
2005-05-17 1:28 ` Jamie Lokier
2005-05-17 5:34 ` Miklos Szeredi
[not found] ` <1116360352.24560.85.camel@localhost>
[not found] ` <E1DYI0m-0000K5-00@dorka.pomaz.szeredi.hu>
[not found] ` <1116399887.24560.116.camel@localhost>
[not found] ` <1116400118.24560.119.camel@localhost>
2005-05-18 9:51 ` [PATCH] fix race in mark_mounts_for_expiry() Miklos Szeredi
2005-05-18 10:32 ` David Howells
2005-05-18 10:37 ` Miklos Szeredi
2005-05-18 10:46 ` David Howells
2005-05-18 10:53 ` Miklos Szeredi
2005-05-18 11:07 ` Trond Myklebust
2005-05-18 11:32 ` Miklos Szeredi
2005-05-18 12:50 ` Jamie Lokier
2005-05-18 13:21 ` Miklos Szeredi
2005-05-18 17:34 ` Jamie Lokier
2005-05-18 19:05 ` Miklos Szeredi
2005-05-18 19:52 ` Jamie Lokier
2005-05-19 12:41 ` Miklos Szeredi
2005-05-18 10:59 ` David Howells
2005-05-18 11:14 ` Miklos Szeredi
2005-05-18 11:51 ` David Howells
2005-05-18 12:08 ` Miklos Szeredi
2005-05-18 12:33 ` Miklos Szeredi
2005-05-18 16:53 ` Miklos Szeredi
2005-05-18 18:47 ` Ram
2005-05-18 19:19 ` Miklos Szeredi
2005-05-18 20:35 ` Ram
2005-05-19 12:52 ` Miklos Szeredi
2005-05-17 18:48 ` [PATCH] namespace.c: fix bind mount from foreign namespace Ram
2005-05-17 0:00 ` Jamie Lokier
-- strict thread matches above, loose matches on Subject: below --
2005-05-16 19:51 Miklos Szeredi
2005-05-17 1:23 ` Jamie Lokier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1116256279.4154.41.camel@localhost \
--to=linuxram@us.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).