public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: akpm@linux-foundation.org, serue@us.ibm.com,
	viro@ftp.linux.org.uk, linuxram@us.ibm.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	containers@lists.osdl.org
Subject: Re: [patch 2/8] allow unprivileged umount
Date: Sun, 22 Apr 2007 01:09:54 -0600	[thread overview]
Message-ID: <m1wt0428cd.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <E1HfVr9-000431-00@dorka.pomaz.szeredi.hu> (Miklos Szeredi's message of "Sun, 22 Apr 2007 08:47:31 +0200")

Miklos Szeredi <miklos@szeredi.hu> writes:

> Does this mean, that containers will need this?  Or that you don't
> know yet?

The uid namespace is something we have to handle carefully and we
have not decided on the final design.

What is clear is that all permission checks will need to become
either (uid namspace, uid) tuple comparisons.  Or struct user
pointer comparisons.  To see if we are talking about the same
uid.

So the eventual uid namespace combined with the possibility
for rlimits if we use struct user *.  See to make using a struct
user a clear win.

>> storing a user struct on each mount point seems sane, plus it allows
>> per user mount rlimits which is major plus.  Especially since we
>> seem to be doing accounting only for user mounts a per user rlimit
>> seems good.
>
> I'm not against per-user rlimits for mounts, but I'd rather do this
> later...

Then let's add a non-discriminate limit.  Instead of a limit that
applies only to root.

>> To get the user we should be user fs_uid as HPA suggested.
>
> fsuid is exclusively used for checking file permissions, which we
> don't do here anymore.  So while it could be argued, that mount() _is_
> a filesystem operation, it is really a different sort of filesystem
> operation than the rest.
>
> OTOH it wouldn't hurt to use fsuid instead of ruid...

Yes.  I may be confused but I'm pretty certain we want either
the fsuid or the euid to be the mount owner.  ruid just looks wrong.
The fsuid is a special case of the effective uid.  Which is who
we should perform operations as.  Unless I'm just confused.

>> Finally I'm pretty certain the capability we should care about in
>> this context is CAP_SETUID.  Instead of CAP_SYS_ADMIN.
>> 
>> If we have CAP_SETUID we can become which ever user owns the mount,
>> and the root user in a container needs this, so he can run login
>> programs.  So changing the appropriate super user checks from
>> CAP_SYS_ADMIN to CAP_SETUID I think is the right thing todo.
>
> That's a flawed logic.  If you want to mount as a specific user, and
> you have CAP_SETUID, then just use set*uid() and then mount().

Totally agreed for mount.

> Changing the capability check for mount() would break the userspace
> ABI.

Sorry I apparently wasn't clear.  CAP_SETUID should be the capability
check for umount.

Hopefully my other more detail replies helped with this.

Eric

  reply	other threads:[~2007-04-22  7:11 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20 10:25 [patch 0/8] mount ownership and unprivileged mount syscall (v4) Miklos Szeredi
2007-04-20 10:25 ` [patch 1/8] add user mounts to the kernel Miklos Szeredi
2007-04-21  7:55   ` Andrew Morton
2007-04-21  8:06     ` Miklos Szeredi
2007-04-21 13:14   ` Eric W. Biederman
2007-04-22  7:02     ` Miklos Szeredi
2007-04-22  7:43       ` Eric W. Biederman
2007-04-22  8:05         ` Miklos Szeredi
2007-04-22 16:22         ` Miklos Szeredi
2007-04-20 10:25 ` [patch 2/8] allow unprivileged umount Miklos Szeredi
2007-04-21  7:55   ` Andrew Morton
2007-04-21  8:01     ` H. Peter Anvin
2007-04-21  8:09     ` Miklos Szeredi
2007-04-21  8:36       ` Andrew Morton
2007-04-21 12:53         ` Eric W. Biederman
2007-04-22  6:47           ` Miklos Szeredi
2007-04-22  7:09             ` Eric W. Biederman [this message]
2007-04-22  7:32               ` Miklos Szeredi
2007-04-21 13:29   ` Eric W. Biederman
2007-04-22  7:05     ` Miklos Szeredi
2007-04-20 10:25 ` [patch 3/8] account user mounts Miklos Szeredi
2007-04-21  7:55   ` Andrew Morton
2007-04-21 13:37   ` Eric W. Biederman
2007-04-22  7:10     ` Miklos Szeredi
2007-04-22  7:49       ` Eric W. Biederman
2007-04-22  8:08         ` Miklos Szeredi
2007-04-20 10:25 ` [patch 4/8] propagate error values from clone_mnt Miklos Szeredi
2007-04-21 13:40   ` Eric W. Biederman
2007-04-20 10:25 ` [patch 5/8] allow unprivileged bind mounts Miklos Szeredi
2007-04-21 14:00   ` Eric W. Biederman
2007-04-22  7:19     ` Miklos Szeredi
2007-04-20 10:25 ` [patch 6/8] put declaration of put_filesystem() in fs.h Miklos Szeredi
2007-04-20 10:25 ` [patch 7/8] allow unprivileged mounts Miklos Szeredi
2007-04-21  7:55   ` Andrew Morton
2007-04-21  8:13     ` Miklos Szeredi
2007-04-21  8:23       ` Miklos Szeredi
2007-04-21 14:10     ` Eric W. Biederman
2007-04-21 15:43       ` Jan Engelhardt
2007-04-21 16:57         ` Eric W. Biederman
2007-04-21 17:10           ` Jan Engelhardt
2007-04-21 21:00             ` Eric W. Biederman
2007-04-22  8:19               ` Miklos Szeredi
2007-04-21 22:06     ` Andi Kleen
2007-04-21 21:33       ` Eric W. Biederman
2007-04-22  0:46     ` Shaya Potter
2007-04-20 10:25 ` [patch 8/8] allow unprivileged fuse mounts Miklos Szeredi
2007-04-21  7:55   ` Andrew Morton
2007-04-21  8:16     ` Miklos Szeredi
2007-04-21 14:18   ` Eric W. Biederman
2007-04-22  7:22     ` Miklos Szeredi
2007-04-20 12:42 ` [patch 0/8] mount ownership and unprivileged mount syscall (v4) Serge E. Hallyn
2007-04-20 16:33   ` Eric W. Biederman
2007-04-21  8:30 ` Majkls
2007-04-21  8:35   ` Miklos Szeredi
2007-04-25  0:04 ` Karel Zak
2007-04-25  1:04   ` Eric W. Biederman
2007-04-25  7:18   ` Miklos Szeredi
2007-04-25  9:23     ` Karel Zak
  -- strict thread matches above, loose matches on Subject: below --
2007-04-04 18:30 [patch 0/8] unprivileged mount syscall Miklos Szeredi
2007-04-04 18:30 ` [patch 2/8] allow unprivileged umount 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=m1wt0428cd.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --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