public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ram Pai <linuxram@us.ibm.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: serue@us.ibm.com, akpm@linux-foundation.org,
	linux-fsdevel@vger.kernel.org, containers@lists.osdl.org,
	util-linux-ng@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 0/8] unprivileged mount syscall
Date: Tue, 10 Apr 2007 01:38:04 -0700	[thread overview]
Message-ID: <1176194285.2903.67.camel@ram.us.ibm.com> (raw)
In-Reply-To: <E1Hb0CH-0000nX-00@dorka.pomaz.szeredi.hu>

On Mon, 2007-04-09 at 22:10 +0200, Miklos Szeredi wrote:
> > > The one in pam-0.99.6.3-29.1 in opensuse-10.2 is totally broken.  Are
> > > you interested in the details?  I can reproduce it, but forgot to note
> > > down the details of the brokenness.
> > 
> > I don't know how far removed that is from the one being used by redhat,
> > but assuming it's the same, then redhat-lspp@redhat.com will be
> > very interested.
> 
> OK.
> 
> > >  - user namespace setup: what if user has multiple sessions?
> > > 
> > >    1) namespaces are shared?  That's tricky because the session needs to
> > >    be a child of a namespace server, not of login.  I'm not sure PAM
> > >    can handle this
> > > 
> > >    2) or mounts are copied on login?  That's not possible currently,
> > >    as there's no way to send a mount between namespaces.  Also it's
> > >    tricky to make sure that new mounts are also shared
> > 
> > See toward the end of the 'shared subtrees' OLS paper from last year for
> > a suggestion on how to let users effectively 'log in to' an existing
> > private mounts ns.
> 
> This?
> 
>   1. create a new namespace
>   2. bind /share/$USER to /share
>   3. for each pair ($who, $what) such that
>      /share/$USER/$who/$what exists, look
>      in /share/$who/allowed for "peer $what
>      $USER" or "slave $what $USER". If the
>      former is found, rbind /share/$who/$what
>      on /share/$USER/$who/$what; if the
>      latter is found, do the same and
>      follow with marking subtree under
>      /share/$USER/$who/$what as slave.
>   4. rbind /share/$USER to /share
>   5. mark subtree under /share as private.
>   6. umount -l /share
> 
> Well, someone please explain using short words, because I don't
> understand at all.

I am trying to re-construct Viro's thoughts.  I think the steps outlined
above; though not accurate, are still insightful.

The idea is -- there is one master namespace, which has
under /share, a replica of the mount tree of namespaces belonging to all
users. 

for example if there are two users A and B, then in the master namespace
under /share you will find /share/A and /share/B, each reflecting the
mount tree for the namespaces belonging to user-A and user-B
respectively. 

Note: /share is a shared mount-tree, which means it can propagate mount
events.

Everytime the user logs on the machine, a new namespace is created which
is the clone of the master namespace. In this new namespace,
the /share/$user is made the root of the namespace. Also if other
users have allowed part of their namespace available to this user,
than those mounts are also brought under this namespace. And finally the
entire tree under /share is unmounted.

Note, though multiple namespaces can exist simultaneously for the same
user, the user is provided the illusion of per-process-namespace since
all the namespaces look identical.  

I am trying to rewrite the steps outlined above, which may or may not
reflect Viro's thoughts, but certainly reflect my reconstruction of
viro's thoughts.

1. clone the master namespace.

2. in the new namespace

	move the tree under /share/$me to /
        for each ($user, $what, $how) {
            move /share/$user/$what to /$what
	    if ($how == slave) {
                 make the mount tree under /$what as slave
            }
        }
        
3. in the new namespace make the tree under 
       /share as private and unmount /share
                      
             
           
RP


> 
> Thanks,
> Miklos


  reply	other threads:[~2007-04-10  8:39 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070404183012.429274832@szeredi.hu>
2007-04-06 23:02 ` [patch 0/8] unprivileged mount syscall Andrew Morton
2007-04-06 23:16   ` H. Peter Anvin
2007-04-06 23:55     ` Jan Engelhardt
2007-04-07  0:22       ` H. Peter Anvin
2007-04-07  3:40         ` Eric Van Hensbergen
2007-04-07  6:48           ` Miklos Szeredi
2007-04-10  8:52     ` Ian Kent
2007-04-11 10:48       ` Miklos Szeredi
2007-04-11 13:48         ` Ian Kent
2007-04-11 14:26           ` Serge E. Hallyn
2007-04-11 14:27             ` Ian Kent
2007-04-11 14:45               ` Serge E. Hallyn
2007-04-07  6:41   ` Miklos Szeredi
2007-04-09 14:38     ` Serge E. Hallyn
2007-04-09 16:24       ` Miklos Szeredi
2007-04-09 17:07         ` Serge E. Hallyn
2007-04-09 17:46           ` Ram Pai
2007-04-09 18:25             ` H. Peter Anvin
2007-04-10 10:33             ` Karel Zak
2007-04-09 20:10           ` Miklos Szeredi
2007-04-10  8:38             ` Ram Pai [this message]
2007-04-11 10:44               ` Miklos Szeredi
2007-04-11 18:28                 ` Ram Pai
2007-04-13 11:58                   ` Miklos Szeredi
2007-04-13 13:28                     ` Serge E. Hallyn
2007-04-13 14:05                       ` Miklos Szeredi
2007-04-13 21:44                         ` Serge E. Hallyn
2007-04-15 20:39                           ` Miklos Szeredi
2007-04-16  1:11                             ` Serge E. Hallyn
2007-04-16  8:18                         ` Ram Pai
2007-04-16  9:27                           ` Miklos Szeredi
2007-04-16 15:40                             ` Eric W. Biederman
2007-04-16 15:55                               ` Miklos Szeredi
2007-04-13 20:07                     ` Karel Zak
2007-04-15 20:21                       ` Miklos Szeredi
2007-04-16  7:59                     ` Ram Pai

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=1176194285.2903.67.camel@ram.us.ibm.com \
    --to=linuxram@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=serue@us.ibm.com \
    --cc=util-linux-ng@vger.kernel.org \
    /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