From: David Howells <dhowells@redhat.com>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: dhowells@redhat.com, Tycho Andersen <tycho@tycho.pizza>,
Tycho Andersen <tycho@tycho.ws>, James Morris <jmorris@namei.org>,
linux-fsdevel@vger.kernel.org,
containers@lists.linux-foundation.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 09/40] xattr: handle idmapped mounts
Date: Wed, 03 Mar 2021 14:45:07 +0000 [thread overview]
Message-ID: <2203252.1614782707@warthog.procyon.org.uk> (raw)
In-Reply-To: <20210303140522.jwlzrmhhho3lvpmv@wittgenstein>
Christian Brauner <christian.brauner@ubuntu.com> wrote:
> In order to answer this more confidently I need to know a bit more about
> how cachefiles are supposed to work.
>
> From what I gather here it seemed what this code is trying to set here
> is an internal "CacheFiles.cache" extended attribute on the indode. This
> extended attribute doesn't store any uids and gids or filesystem
> capabilities so the user namespace isn't relevant for that since there
> doesn't need to be any conversion.
>
> What I need to know is what information do you use for cachefiles to
> determine whether someone can set that "Cachefiles.cache" extended
> attribute on the inode:
> - Is it the mnt_userns of a/the mount of the filesystem you're caching for?
> - The mnt_userns of the mnt of struct cachefiles_cache?
> - Or the stashed or current creds of the caller?
Mostly it's about permission checking. The cache driver wants to do accesses
onto the files in cache using the context of whatever process writes the
"bind" command to /dev/cachefiles, not the context of whichever process issued
a read or write, say, on an NFS file that is being cached.
This causes standard UNIX perm checking, SELinux checking, etc. all to be
switched to the appropriate context. It also controls what appears in the
audit logs.
There is an exception to this: It also governs the ownership of new files and
directories created in the cache and what security labels will be set on them.
Quite possibly this doesn't matter for the xattr stuff. It's hard to tell
since we use user namespaces to convey so many different things at different
times.
David
next prev parent reply other threads:[~2021-03-03 18:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210121131959.646623-10-christian.brauner@ubuntu.com>
[not found] ` <20210121131959.646623-1-christian.brauner@ubuntu.com>
2021-03-03 13:24 ` David Howells
2021-03-03 14:05 ` Christian Brauner
2021-03-03 14:45 ` David Howells [this message]
2021-03-03 16:15 ` Christian Brauner
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=2203252.1614782707@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=christian.brauner@ubuntu.com \
--cc=containers@lists.linux-foundation.org \
--cc=jmorris@namei.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=tycho@tycho.pizza \
--cc=tycho@tycho.ws \
/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®