mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bodo Eggert <harvested.in.lkml@7eggert.dyndns.org>
To: greg@enjellic.com, Mike Waychison <mikew@google.com>,
	Ram <linuxram@us.ibm.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	leimy2k@gmail.com
Subject: Re: /etc/mtab and per-process namespaces
Date: Sat, 22 Oct 2005 19:26:16 +0200	[thread overview]
Message-ID: <E1ETN8K-0001bd-NO@be1.lrz> (raw)
In-Reply-To: <50rBX-76N-35@gated-at.bofh.it>

Dr. Greg Wettstein <greg@wind.enjellic.com> wrote:
> On Oct 13,  7:10pm, Mike Waychison wrote:
> } Subject: Re: /etc/mtab and per-process namespaces

> I've been pondering the best way to take on the mount problem.
> Current mount binaries seem to fall back to /proc/mounts if /etc/mtab
> is not present.  All bets are off of course if the mount binary is
> used for the bind mount since a new /etc/mtab is created.
> 
> I'm willing to whack on the mount binary a bit as part of this.  The
> obvious solution is to teach mount to act differently if it is running
> in a private namespace.  If anybody knows of a good way to detect this
> I would be interested in knowing that.  In newns (the namespace sudo
> tool) I'm setting an environment variable for mount to detect on but a
> system level approach would be more generic.

- If named namespaces are to be implemented, you could check for a set
  namespace ID. (You could also get rid of the persistent-namespace-daemon.)

- If secure user mounts are implemented, missing privileges will be hint.
  Privileged mounts will require a global configuration where a flag can
  be set. (BTW: You'll also want to disable user mounts in global namespaces
  to catch errors, abuse and exploits)

- Until any of these is implemented, users will run in a private namespace,
  so UID != EUID will indicate a private namespace. Unfortunately this is
  not secure, but:

- If the proc/mounts information is extended as described below, a different
  behaviour wouldn't make sense anymore, would it?

> The other problem is the information exported in /proc/mounts.  It
> would seem problematic to modify its format but in order to serve as a
> useful source of information for a modified mount binary it would need
> to contain mount option information.  Since this is definitely process
> specific information it would seem to call for something in /proc
> rather than /sysfs.  Do we need a new pseudo-file?

- The file format is broken for whitespace in filenames, so changing the
  format in these cases by adding quoting won't actually break anything.

- The userspace options (loop device etc) can be encoded in the mount
  options field, e.g.
  'rw,mount=lo:"/home/Arthur Dent/iso":/dev/loop/42;ns=public,async'.

So if you _want_ to keep the format, you can IMHO do so. Maybe you can
think of something better, who knows? We'll need to upgrade the tools
to use non-broken semantics anyway, so as long as you keep the old file
around, this should be no real problem.

-- 
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.

       reply	other threads:[~2005-10-22 17:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <50rBX-76N-37@gated-at.bofh.it>
     [not found] ` <50rBX-76N-35@gated-at.bofh.it>
2005-10-22 17:26   ` Bodo Eggert [this message]
2005-10-22 13:23 Dr. Greg Wettstein
2005-10-29  0:06 ` Ram Pai
2005-10-29 10:16   ` Rob Landley
2005-10-31 19:11     ` Ram Pai
2005-10-31 23:27       ` Rob Landley
2005-11-01  0:01         ` Ram Pai
2005-11-01  7:36         ` Miklos Szeredi
2005-11-01  8:44           ` Rob Landley
     [not found] <4TkbZ-6KJ-9@gated-at.bofh.it>
     [not found] ` <4U0uy-33E-7@gated-at.bofh.it>
     [not found]   ` <4U0XK-3Gp-47@gated-at.bofh.it>
2005-10-04 21:20     ` Bodo Eggert
2005-10-05  0:14       ` Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2005-10-02 22:08 David Leimbach
2005-10-04 19:14 ` David Leimbach
2005-10-04 19:18   ` Christoph Hellwig
2005-10-04 19:49     ` Michael Tokarev
2005-10-04 19:52     ` David Leimbach
2005-10-04 19:43   ` Al Viro
2005-10-04 20:07     ` David Leimbach
2005-10-04 20:20       ` Al Viro
2005-10-05 16:29   ` Ram
2005-10-14  2:10     ` Mike Waychison
2005-10-17  0:47       ` Ian Kent
2005-10-20  3:53         ` Rob Landley
2005-10-20  3:42 ` Rob Landley

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=E1ETN8K-0001bd-NO@be1.lrz \
    --to=harvested.in.lkml@7eggert.dyndns.org \
    --cc=7eggert@gmx.de \
    --cc=greg@enjellic.com \
    --cc=leimy2k@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=mikew@google.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

all inboxes | Powered by JetHome®