From: Ram Pai <linuxram@us.ibm.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: serue@us.ibm.com, devel@openvz.org, linux-kernel@vger.kernel.org,
containers@lists.osdl.org, viro@ftp.linux.org.uk,
linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag
Date: Tue, 17 Apr 2007 13:25:04 -0700 [thread overview]
Message-ID: <1176841504.2813.124.camel@ram.us.ibm.com> (raw)
In-Reply-To: <E1Hdtai-0002Ri-00@dorka.pomaz.szeredi.hu>
On Tue, 2007-04-17 at 21:43 +0200, Miklos Szeredi wrote:
> > > > I'm a bit lost about what is currently done and who advocates for what.
> > > >
> > > > It seems to me the MNT_ALLOWUSERMNT (or whatever :) flag should be
> > > > propagated. In the /share rbind+chroot example, I assume the admin
> > > > would start by doing
> > > >
> > > > mount --bind /share /share
> > > > mount --make-slave /share
> > > > mount --bind -o allow_user_mounts /share (or whatever)
> > > > mount --make-shared /share
> > > >
> > > > then on login, pam does
> > > >
> > > > chroot /share/$USER
> > > >
> > > > or some sort of
> > > >
> > > > mount --bind /share /home/$USER/root
> > > > chroot /home/$USER/root
> > > >
> > > > or whatever. In any case, the user cannot make user mounts except under
> > > > /share, and any cloned namespaces will still allow user mounts.
> > >
> > > I don't quite understand your method. This is how I think of it:
> > >
> > > mount --make-rshared /
> > > mkdir -p /mnt/ns/$USER
> > > mount --rbind / /mnt/ns/$USER
> > > mount --make-rslave /mnt/ns/$USER
> > > mount --set-flags --recursive -oallowusermnt /mnt/ns/$USER
> > > chroot /mnt/ns/$USER
> > > su - $USER
> > >
> > > I did actually try something equivalent (without the fancy mount
> > > commands though), and it worked fine. The only "problem" is the
> > > proliferation of mounts in /proc/mounts. There was a recently posted
> > > patch in AppArmor, that at least hides unreachable mounts from
> > > /proc/mounts, so the user wouldn't see all those. But it could still
> > > be pretty confusing to the sysadmin.
> >
> > unbindable mounts were designed to overcome the proliferation problem.
> >
> > Your steps should be something like this:
> >
> > mount --make-rshared /
> > mkdir -p /mnt/ns
> > mount --bind /mnt/ns /mnt/ns
> > mount --make-unbindable /mnt/ns
> > mkdir -p /mnt/ns/$USER
> > mount --rbind / /mnt/ns/$USER
> > mount --make-rslave /mnt/ns/$USER
> > mount --set-flags --recursive -oallowusermnt /mnt/ns/$USER
> > chroot /mnt/ns/$USER
> > su - $USER
> >
> > try this and your proliferation problem will disappear. :-)
>
> Right, this is needed.
>
> My problem wasn't actually this (which would only have hit, if I tried
> with more than one user), just that the number of mounts in
> /proc/mounts grows linearly with the number of users.
>
> That can't be helped in such an easy way unfortunately.
>
> > > Propagating some mount flags and not propagating others is
> > > inconsistent and confusing, so I wouldn't want that. Currently
> > > remount doesn't propagate mount flags, that may be a bug,
> >
> > For consistency reason, one can propagate all the flags. But
> > propagating only those flags that interfere with shared-subtree
> > semantics should suffice.
>
> I still don't believe not propagating "allowusermnt" interferes with
> mount propagation. In my posted patches the mount (including
> propagations) is allowed based on the "allowusermnt" flag on the
> parent of the requested mount. The flag is _not_ checked during
> propagation.
>
> Allowing this and other flags to NOT be propagated just makes it
> possible to have a set of shared mounts with asymmetric properties,
> which may actually be desirable.
The shared mount feature was designed to ensure that the mount remained
identical at all the locations. Now designing features
to make it un-identical but still naming it shared, will break its
original purpose. Slave mounts were designed to make it asymmetric.
Whatever feature that is desired to be exploited; can that be exploited
with the current set of semantics that we have? Is there a real need to
make the mounts asymmetric but at the same time name them as shared?
Maybe I dont understand what the desired application is?
RP
>
> Miklos
next prev parent reply other threads:[~2007-04-17 20:26 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-12 16:45 [patch 00/10] (resend) mount ownership and unprivileged mount syscall Miklos Szeredi
2007-04-12 16:45 ` [patch 01/10] add user mounts to the kernel Miklos Szeredi
2007-04-12 16:45 ` [patch 02/10] allow unprivileged umount Miklos Szeredi
2007-04-12 16:45 ` [patch 03/10] account user mounts Miklos Szeredi
2007-04-12 16:45 ` [patch 04/10] add "permit user mounts" flag to namespaces Miklos Szeredi
2007-04-12 16:45 ` [patch 05/10] add "permit user mounts in new namespace" clone flag Miklos Szeredi
2007-04-12 20:32 ` Serge E. Hallyn
2007-04-13 4:16 ` Herbert Poetzl
2007-04-13 7:09 ` Miklos Szeredi
2007-04-13 4:45 ` Eric W. Biederman
2007-04-13 7:12 ` Miklos Szeredi
2007-04-13 13:47 ` Serge E. Hallyn
2007-04-13 14:22 ` Eric W. Biederman
2007-04-16 8:47 ` [Devel] " Ram Pai
2007-04-16 9:32 ` Miklos Szeredi
2007-04-16 9:49 ` Ram Pai
2007-04-16 9:56 ` Miklos Szeredi
2007-04-16 15:43 ` Eric W. Biederman
2007-04-16 15:58 ` Miklos Szeredi
2007-04-16 19:16 ` Eric W. Biederman
2007-04-16 19:56 ` Serge E. Hallyn
2007-04-17 9:04 ` Eric W. Biederman
2007-04-17 11:09 ` Miklos Szeredi
2007-04-17 18:16 ` Eric W. Biederman
2007-04-17 18:36 ` Miklos Szeredi
2007-04-17 19:54 ` Eric W. Biederman
2007-04-18 9:11 ` Miklos Szeredi
2007-04-18 13:55 ` Trond Myklebust
2007-04-18 14:03 ` Miklos Szeredi
2007-04-18 14:26 ` Trond Myklebust
2007-04-18 15:01 ` Christoph Hellwig
2007-04-18 19:00 ` Trond Myklebust
2007-04-18 15:06 ` Miklos Szeredi
2007-04-18 17:14 ` Eric W. Biederman
2007-04-18 18:05 ` Miklos Szeredi
2007-04-19 9:02 ` Miklos Szeredi
2007-04-17 14:25 ` Serge E. Hallyn
2007-04-17 14:28 ` Serge E. Hallyn
2007-04-16 17:14 ` Ram Pai
2007-04-16 17:50 ` Miklos Szeredi
2007-04-17 17:07 ` Serge E. Hallyn
2007-04-17 17:44 ` Miklos Szeredi
2007-04-17 18:15 ` Serge E. Hallyn
2007-04-17 18:58 ` Miklos Szeredi
2007-04-17 19:28 ` Ram Pai
2007-04-17 19:43 ` Miklos Szeredi
2007-04-17 20:25 ` Ram Pai [this message]
2007-04-18 9:19 ` Miklos Szeredi
2007-04-18 18:35 ` Ram Pai
2007-04-18 19:14 ` Miklos Szeredi
2007-04-18 19:41 ` Ram Pai
2007-04-19 8:36 ` Miklos Szeredi
2007-04-12 16:45 ` [patch 06/10] propagate error values from clone_mnt Miklos Szeredi
2007-04-12 16:45 ` [patch 07/10] allow unprivileged bind mounts Miklos Szeredi
2007-04-12 16:45 ` [patch 08/10] put declaration of put_filesystem() in fs.h Miklos Szeredi
2007-04-12 16:45 ` [patch 09/10] allow unprivileged mounts Miklos Szeredi
2007-04-12 16:45 ` [patch 10/10] allow unprivileged fuse mounts Miklos Szeredi
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=1176841504.2813.124.camel@ram.us.ibm.com \
--to=linuxram@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.osdl.org \
--cc=devel@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=serue@us.ibm.com \
--cc=viro@ftp.linux.org.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