Linux Container Development
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH user-cr] add -t option to mount new devpts
Date: Fri, 12 Feb 2010 11:05:28 -0600	[thread overview]
Message-ID: <20100212170528.GB15333@us.ibm.com> (raw)
In-Reply-To: <4B7582CD.9070900-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org):
> 
> Sorry for the late response ...
> 
> Serge E. Hallyn wrote:
> >Trivial patch, and I'm not sure whether we want this or want to
> >do it this way.  But it saves me having to do it during my restart.sh
> >wrapper shell-script.
> 
> This looks useful.
> 
> I wonder if it makes sense to generalize that to allow the user
> to request any mount (and multiple mounts), e.g.
> 	restart --mount="......" --mount="......." ...

Or just a --fstab=some_file option?

> With this switch, 'restart' will create a new mntns and do the
> mounts in it.
> 
> We can then add shortcuts, like --mount-ptys.
> 
> However, I'm concerned about the security implications: ideally
> 'restart' will be setuid executable, so it must be prudent in
> accepting such generic requests as 'mount'.

Hmm, we could use our own mount binary, which is willing to
mount things like devpts and proc as root (since that's completely
private) but otherwise runs the mounts as the original user?  Eventually
do that on top of Miklos' unprivileged-mounts patchset, which will allow
bind mounts on top of dirs/files to which the user has write access.  In
the meantime other mounts would only be allowed if the user was
originally root.

So basically our mount binary would be run with euid=0 and
ruid=suid=N where N is the original userid.

> This last argument is also valid if we stay with this patch,
> because it is racy (time of check to time of use).

Yeah I'm not sure we can solve this right now.  We might be best
off saying that only ruid=0 can do the mounts, and mention something
about setuid-root restart.c can trust TPM-signed checkpoint images.

-serge

      parent reply	other threads:[~2010-02-12 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04  1:43 [PATCH user-cr] add -t option to mount new devpts Serge E. Hallyn
     [not found] ` <20091204014347.GA17304-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-12 16:33   ` Oren Laadan
     [not found]     ` <4B7582CD.9070900-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-02-12 17:05       ` Serge E. Hallyn [this message]

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=20100212170528.GB15333@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.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