From: Ian Kent <raven@themaw.net>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Linux Containers <containers@lists.linux-foundation.org>,
linux-kernel@vger.kernel.org,
Miklos Szeredi <mszeredi@redhat.com>,
linux-fsdevel@vger.kernel.org,
Seth Forshee <seth.forshee@canonical.com>
Subject: Re: [PATCH 0/2] userns: automount cleanups
Date: Thu, 30 Nov 2017 17:11:26 +0800 [thread overview]
Message-ID: <bdda8d98-644e-9ce6-f858-9f751d2fe92c@themaw.net> (raw)
In-Reply-To: <877eu8ibor.fsf@xmission.com>
On 30/11/17 13:21, Eric W. Biederman wrote:
> Ian Kent <raven@themaw.net> writes:
>
>> On 30/11/17 08:01, Eric W. Biederman wrote:
>>>
>>> While reviewing some code I realized that in getting d_automount working
>>> with s_user_ns I had left behind some unnecessary relics of the blind
>>> path I started down. Here are two patches that remove those relics.
>>>
>>> Unless someone has another preference I will drop them in my userns tree
>>> and merge them that way.
>>
>> I saw the "<etc>->s_user_ns != &init_user_ns" and wondered if that would
>> trigger for automount(8) run entirely with a container (eg. docker)?
>
> autofs still needs FS_USERNS_MOUNT before you can reach that point. But
> docker does have a mode ?--userns-remap? where it sets up the containers
> mounts that way.
>
> I think in principle that should work and be safe. I don't know how
> robust autofs is against malicious users. Which is the question to ask
> before actually adding FS_USERNS_MOUNT in struct file_system_type.
automount(8) thinks it is running as uid 0 (which it is in the container)
so this would require a bit of thought since automount(8) doesn't take
special precautions.
The restrictions, in the case of running entirely within a container, are
those of the container itself. For example, if there are no granular
capabilities available then the admin needs to run the container as
privileged in order to be able to mount NFS file systems, which is a
common usage case.
Ian
prev parent reply other threads:[~2017-11-30 9:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 0:01 Eric W. Biederman
2017-11-30 0:04 ` [PATCH 1/2] userns: Don't fail follow_automount based on s_user_ns Eric W. Biederman
2017-11-30 0:05 ` [PATCH 2/2] autofs4: Modify autofs_wait to use current_uid() and current_gid() Eric W. Biederman
2017-11-30 0:11 ` [PATCH 0/2] userns: automount cleanups Ian Kent
2017-11-30 5:21 ` Eric W. Biederman
2017-11-30 9:11 ` Ian Kent [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=bdda8d98-644e-9ce6-f858-9f751d2fe92c@themaw.net \
--to=raven@themaw.net \
--cc=containers@lists.linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=seth.forshee@canonical.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®