From: "Serge E. Hallyn" <serue@us.ibm.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
linuxram@us.ibm.com, linux-fsdevel@vger.kernel.org,
viro@ftp.linux.org.uk, containers@lists.osdl.org,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag
Date: Mon, 16 Apr 2007 14:56:52 -0500 [thread overview]
Message-ID: <20070416195652.GA350@sergelap.austin.ibm.com> (raw)
In-Reply-To: <m1zm58jfj3.fsf@ebiederm.dsl.xmission.com>
Quoting Eric W. Biederman (ebiederm@xmission.com):
> Miklos Szeredi <miklos@szeredi.hu> writes:
>
> >> > That depends. Current patches check the "unprivileged submounts
> >> > allowed under this mount" flag only on the requested mount and not on
> >> > the propagated mounts. Do you see a problem with this?
> >>
> >> I think privileges of this sort should propagate. If I read what you
> >> just said correctly if I have a private mount namespace I won't be able
> >> to mount anything unless when it was setup the unprivileged submount
> >> command was explicitly set.
> >
> > By design yes. Why is that a problem?
>
> It certainly doesn't match my intuition.
>
> Why are directory permissions not sufficient to allow/deny non-priveleged mounts?
> I don't understand that contention yet.
The same scenarios laid out previously in this thread. I.e.
1. user hallyn does mount --bind / /home/hallyn/root
2. (...)
3. admin does "deluser hallyn"
and deluser starts wiping out root
Or,
1. user hallyn does mount --bind / /home/hallyn/root
2. backup daemon starts backing up /home/hallyn/root/home/hallyn/root/home...
So we started down the path of forcing users to clone a new namespace
before doing user mounts, which is what the clone flag was about. Using
per-mount flags also suffices as you had pointed out, which is being
done here. But directory permissions are inadequate.
(Unless you want to tackle each problem legacy tool one at a time to
remove problems - i.e. deluser should umount everything under
/home/hallyn before deleting, backup should be spawned from it's own
namespace cloned right after boot or just back up on one filesystem,
etc.)
-serge
> I should probably go back and look and see how plan9 handles mount/unmount
> permissions. Plan9 gets away with a lot more because it doesn't have
> a suid bit and mount namespaces were always present, so they don't have
> backwards compatibility problems.
>
> My best guess at the moment is that plan9 treated mount/unmount as
> completely unprivileged and used the mount namespaces to limit the
> scope of what would be affected by a mount/unmount operation. I think
> that may be reasonable in linux as well but it will require the
> presence of a mount namespace to limit the affects of what a user can
> do.
>
> So short of a more thorough audit I believe the final semantics should
> be:
> - mount/unmount for non-priveleged processes should only be limited
> by the mount namespace and directory permissions.
> - CLONE_NEWNS should not be a privileged operation.
>
> What prevents us from allowing these things?
>
> - Unprivileged CLONE_NEWNS and unprivileged mounts needs resource
> accounting so we don't have a denial of service attack.
>
> - Unprivileged mounts must be limited to directories that we have
> permission to modify in a way that we could get the same effect
> as the mount or unmount operation in terms of what files are visible
> otherwise we can mess up SUID executables.
>
> - Anything else?
>
> There are user space issues such as a reasonable pam module and how
> to do backups. However those are user space issues.
>
> What am I missing that requires us to add MNT_USER and MNT_USERMNT?
>
> Eric
> -
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2007-04-16 19:57 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-12 16:45 [patch 00/10] (resend) mount ownership and unprivileged mount syscall Miklos Szeredi
2007-04-12 16:45 ` [patch 01/10] add user mounts to the kernel Miklos Szeredi
2007-04-12 16:45 ` [patch 02/10] allow unprivileged umount Miklos Szeredi
2007-04-12 16:45 ` [patch 03/10] account user mounts Miklos Szeredi
2007-04-12 16:45 ` [patch 04/10] add "permit user mounts" flag to namespaces Miklos Szeredi
2007-04-12 16:45 ` [patch 05/10] add "permit user mounts in new namespace" clone flag Miklos Szeredi
2007-04-12 20:32 ` Serge E. Hallyn
2007-04-13 4:16 ` Herbert Poetzl
2007-04-13 7:09 ` Miklos Szeredi
2007-04-13 4:45 ` Eric W. Biederman
2007-04-13 7:12 ` Miklos Szeredi
2007-04-13 13:47 ` Serge E. Hallyn
2007-04-13 14:22 ` Eric W. Biederman
2007-04-16 8:47 ` [Devel] " Ram Pai
2007-04-16 9:32 ` Miklos Szeredi
2007-04-16 9:49 ` Ram Pai
2007-04-16 9:56 ` Miklos Szeredi
2007-04-16 15:43 ` Eric W. Biederman
2007-04-16 15:58 ` Miklos Szeredi
2007-04-16 19:16 ` Eric W. Biederman
2007-04-16 19:56 ` Serge E. Hallyn [this message]
2007-04-17 9:04 ` Eric W. Biederman
2007-04-17 11:09 ` Miklos Szeredi
2007-04-17 18:16 ` Eric W. Biederman
2007-04-17 18:36 ` Miklos Szeredi
2007-04-17 19:54 ` Eric W. Biederman
2007-04-18 9:11 ` Miklos Szeredi
2007-04-18 13:55 ` Trond Myklebust
2007-04-18 14:03 ` Miklos Szeredi
2007-04-18 14:26 ` Trond Myklebust
2007-04-18 15:01 ` Christoph Hellwig
2007-04-18 19:00 ` Trond Myklebust
2007-04-18 15:06 ` Miklos Szeredi
2007-04-18 17:14 ` Eric W. Biederman
2007-04-18 18:05 ` Miklos Szeredi
2007-04-19 9:02 ` Miklos Szeredi
2007-04-17 14:25 ` Serge E. Hallyn
2007-04-17 14:28 ` Serge E. Hallyn
2007-04-16 17:14 ` Ram Pai
2007-04-16 17:50 ` Miklos Szeredi
2007-04-17 17:07 ` Serge E. Hallyn
2007-04-17 17:44 ` Miklos Szeredi
2007-04-17 18:15 ` Serge E. Hallyn
2007-04-17 18:58 ` Miklos Szeredi
2007-04-17 19:28 ` Ram Pai
2007-04-17 19:43 ` Miklos Szeredi
2007-04-17 20:25 ` Ram Pai
2007-04-18 9:19 ` Miklos Szeredi
2007-04-18 18:35 ` Ram Pai
2007-04-18 19:14 ` Miklos Szeredi
2007-04-18 19:41 ` Ram Pai
2007-04-19 8:36 ` Miklos Szeredi
2007-04-12 16:45 ` [patch 06/10] propagate error values from clone_mnt Miklos Szeredi
2007-04-12 16:45 ` [patch 07/10] allow unprivileged bind mounts Miklos Szeredi
2007-04-12 16:45 ` [patch 08/10] put declaration of put_filesystem() in fs.h Miklos Szeredi
2007-04-12 16:45 ` [patch 09/10] allow unprivileged mounts Miklos Szeredi
2007-04-12 16:45 ` [patch 10/10] allow unprivileged fuse mounts 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=20070416195652.GA350@sergelap.austin.ibm.com \
--to=serue@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.osdl.org \
--cc=ebiederm@xmission.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=miklos@szeredi.hu \
--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