From: Trond Myklebust <trondmy@hammerspace.com>
To: "alban.crequy@gmail.com" <alban.crequy@gmail.com>,
"sargun@sargun.me" <sargun@sargun.me>
Cc: "mauricio@kinvolk.io" <mauricio@kinvolk.io>,
"smayhew@redhat.com" <smayhew@redhat.com>,
"dhowells@redhat.com" <dhowells@redhat.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"chuck.lever@oracle.com" <chuck.lever@oracle.com>,
"schumaker.anna@gmail.com" <schumaker.anna@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"bfields@fieldses.org" <bfields@fieldses.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"anna.schumaker@netapp.com" <anna.schumaker@netapp.com>
Subject: Re: [PATCH v4 0/2] NFS: Fix interaction between fs_context and user namespaces
Date: Tue, 10 Nov 2020 20:12:01 +0000 [thread overview]
Message-ID: <f6d86006ccd19d4d101097de309eb21bbbf96e43.camel@hammerspace.com> (raw)
In-Reply-To: <CAMXgnP5cVoLKTGPOAO+aLEAGLpkjACy1e4iLBKkfp8Gv1U77xA@mail.gmail.com>
On Tue, 2020-11-10 at 17:43 +0100, Alban Crequy wrote:
> Hi,
>
> I tested the patches on top of 5.10.0-rc3+ and I could mount an NFS
> share with a different user namespace. fsopen() is done in the
> container namespaces (user, mnt and net namespaces) while fsconfig(),
> fsmount() and move_mount() are done on the host namespaces. The mount
> on the host is available in the container via mount propagation from
> the host mount.
>
> With this, the files on the NFS server with uid 0 are available in
> the
> container with uid 0. On the host, they are available with uid
> 4294967294 (make_kuid(&init_user_ns, -2)).
>
Can someone please tell me what is broken with the _current_ design
before we start trying to push "fixes" that clearly break it?
The current design assumes that the user namespace being used is the
one where the mount itself is performed. That means that the uids and
gids or usernames and groupnames that go on the wire match the uids and
gids of the container in which the mount occurred.
The assumption is that the server has authenticated that client as
belonging to a domain that it recognises (either through strong
RPCSEC_GSS/krb5 authentication, or through weaker matching of IP
addresses to a list of acceptable clients).
If you go ahead and change the user namespace on the client without
going through the mount process again to mount a different super block
with a different user namespace, then you will now get the exact same
behaviour as if you do that with any other filesystem.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2020-11-10 20:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 17:47 [PATCH v4 0/2] NFS: Fix interaction between fs_context and user namespaces Sargun Dhillon
2020-11-02 17:47 ` [PATCH v4 1/2] NFS: NFSv2/NFSv3: Use cred from fs_context during mount Sargun Dhillon
2020-11-02 17:47 ` [PATCH v4 2/2] NFSv4: Refactor NFS to use user namespaces Sargun Dhillon
2020-11-10 16:43 ` [PATCH v4 0/2] NFS: Fix interaction between fs_context and " Alban Crequy
2020-11-10 20:12 ` Trond Myklebust [this message]
2020-11-11 11:12 ` Sargun Dhillon
2020-11-11 14:38 ` Trond Myklebust
2020-11-11 18:57 ` Sargun Dhillon
2020-11-11 20:03 ` Trond Myklebust
2020-11-12 0:30 ` Sargun Dhillon
2020-11-12 0:42 ` Sargun Dhillon
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=f6d86006ccd19d4d101097de309eb21bbbf96e43.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=alban.crequy@gmail.com \
--cc=anna.schumaker@netapp.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=mauricio@kinvolk.io \
--cc=sargun@sargun.me \
--cc=schumaker.anna@gmail.com \
--cc=smayhew@redhat.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).