linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Glauber Costa <glommer@parallels.com>,
	cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	ebiederm@xmission.com, serge@hallyn.com, daniel.lezcano@free.fr,
	pjt@google.com, mzxreary@0pointer.de, xemul@parallels.com,
	James.Bottomley@HansenPartnership.com, tj@kernel.org,
	eric.dumazet@gmail.com
Subject: Re: [RFC 0/4] per-namespace allowed filesystems list
Date: Tue, 24 Jan 2012 09:17:27 +0200	[thread overview]
Message-ID: <20120124071727.GA22292@shutemov.name> (raw)
In-Reply-To: <20120123231239.GH23916@ZenIV.linux.org.uk>

On Mon, Jan 23, 2012 at 11:12:39PM +0000, Al Viro wrote:
> On Tue, Jan 24, 2012 at 01:04:57AM +0200, Kirill A. Shutemov wrote:
> > On Mon, Jan 23, 2012 at 09:12:19PM +0000, Al Viro wrote:
> > > This is bloody ridiculous; if you want to prevent a luser adming playing with
> > > the set of mounts you've given it, the right way to go is not to mess with the
> > > "which fs types are allowed" but to add a per-namespace "immutable" flag.
> > > And add a new clone(2)/unshare(2) flag, used only along with the CLONE_NEWNS
> > > and setting the "immutable" on the copied namespace.
> > 
> > How will it work if we want to allow namespaced environment to mount block
> > devices, but not, let say, debugfs?
> > 
> > Differentiation between filesystem type and source is one of broken things
> > in Unix API.
> 
> Translation, please?

mount(2) should take a file descriptor and mount it to a mountpoint. File
descriptor provides known interface at that point (9p?). It doesn't matter
here what's the actual type of filesystem or what's the source (no fake
names for sources of pseudo-fs).

> > I don't see an easy way to fix it. Only plan9. :)
> 
> Huh?  Plan 9 does *not* contain anything of that kind. And their '#<letter>'
> convention for in-kernel filesystems is one of the uglier things about their
> API, IMO...

Yes, it's ugly. But in plan9 it can be fixed quite straight forward:
- kernel provides a way to boot to an early userspace environment without
  access to any media (initrd);
- kernel provides *one* '#<letter>' fs which contains handles to create
  any other in-kernel filesystems. This special fs can be mounted only
  once. After that you have (about) all resources as files and can
  construct any other environment using mount and bind.

In fact, list of available (pseudo-)filesystems is yet another resource
namespace. With approach above we can get rid of it in plan9.

-- 
 Kirill A. Shutemov

  reply	other threads:[~2012-01-24  7:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23 16:56 [RFC 0/4] per-namespace allowed filesystems list Glauber Costa
     [not found] ` <1327337772-1972-1-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-01-23 16:56   ` [RFC 1/4] move /proc/filesystems inside /proc/self Glauber Costa
2012-01-23 16:56   ` [RFC 4/4] fslist netlink interface Glauber Costa
2012-01-23 19:20   ` [RFC 0/4] per-namespace allowed filesystems list Eric W. Biederman
2012-01-23 21:12   ` Al Viro
     [not found]     ` <20120123211218.GF23916-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2012-01-23 23:04       ` Kirill A. Shutemov
     [not found]         ` <20120123230457.GA14347-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2012-01-23 23:12           ` Al Viro
2012-01-24  7:17             ` Kirill A. Shutemov [this message]
2012-01-24 10:32           ` Glauber Costa
2012-01-24 10:22       ` Glauber Costa
2012-01-23 16:56 ` [RFC 2/4] " Glauber Costa
2012-01-23 16:56 ` [RFC 3/4] show only allowed filesystems in /proc/filesystems Glauber Costa
2012-01-24  0:04 ` [RFC 0/4] per-namespace allowed filesystems list Eric W. Biederman
     [not found]   ` <m1vco2m0eh.fsf-+imSwln9KH6u2/kzUuoCbdi2O/JbrIOy@public.gmane.org>
2012-01-24 10:31     ` Glauber Costa
     [not found]       ` <4F1E886A.7000107-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-01-24 11:17         ` Eric W. Biederman
2012-01-24 11:24           ` Glauber Costa

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=20120124071727.GA22292@shutemov.name \
    --to=kirill@shutemov.name \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=cgroups@vger.kernel.org \
    --cc=daniel.lezcano@free.fr \
    --cc=ebiederm@xmission.com \
    --cc=eric.dumazet@gmail.com \
    --cc=glommer@parallels.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mzxreary@0pointer.de \
    --cc=pjt@google.com \
    --cc=serge@hallyn.com \
    --cc=tj@kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    --cc=xemul@parallels.com \
    /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).