linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Seth Forshee <sforshee@digitalocean.com>
To: Christian Brauner <brauner@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-fsdevel@vger.kernel.org, Aleksa Sarai <cyphar@cyphar.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH v2 0/8] introduce dedicated type for idmapped mounts
Date: Thu, 23 Jun 2022 16:01:03 -0500	[thread overview]
Message-ID: <YrTUj0skph2MYTHH@do-x1extreme> (raw)
In-Reply-To: <20220621141454.2914719-1-brauner@kernel.org>

On Tue, Jun 21, 2022 at 04:14:46PM +0200, Christian Brauner wrote:
> From: "Christian Brauner (Microsoft)" <brauner@kernel.org>
> 
> Hey everyone,
> 
> /* v2 */
> No major changes. The type got renamed since we agreed that the initial
> name wasn't great. There are some typo fixes in the commit messages and
> a few tweaks to the last commit and added Jan's rvb.
> 
> This series starts to introduce a new vfs{g,u}id_t type. It allows to
> distinguish {g,u}ids on idmapped mounts from filesystem k{g,u}ids.
> 
> We leverage the type framework to increase the safety for filesystems
> and the vfs when dealing with idmapped mounts.
> 
> The series introduces the type and converts the setattr codepaths to
> use the new type and associated helpers.
> 
> Currently these codepaths place the value that will ultimately be
> written to inode->i_{g,u}id into attr->ia_{g,u}id which allows to avoid
> changing a few callsites. But there are drawbacks to this approach.
> 
> As Linus rightly points out it makes some of the permission checks in
> the attribute code harder to understand than they need and should be and
> increases the probability for further issues.
> 
> This series makes it so that the values will always be treated as being
> mapped into the idmapped mount. Only when the filesystem object is
> actually updated will the value be mapped into the filesystem idmapping.
> 
> I first looked into this about ~7 months ago but put it on hold to focus
> on the testsuite. Linus expressed the desire for something like this
> last week so I got back to working on this.
> 
> I'd like to get at least this first series in for v5.20. The conversion
> can the continue until we can remove all the regular non-type safe
> helpers and will only be left with the type safe helpers.
> 
> Thanks!
> Christian

As I mentioned in my other responses I prefer to see comparisons with
invalid ids always evaluate as not equal. You can take or leave that
suggestion, but even without it this looks correct, and I think a
separate type is a good change to avoid confusion. For all the patches,
feel free to add:

Reviewed-by: Seth Forshee <sforshee@digitalocean.com>

Seth

      parent reply	other threads:[~2022-06-23 21:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21 14:14 [PATCH v2 0/8] introduce dedicated type for idmapped mounts Christian Brauner
2022-06-21 14:14 ` [PATCH v2 1/8] mnt_idmapping: add vfs{g,u}id_t Christian Brauner
2022-06-21 18:22   ` Seth Forshee
2022-06-22  4:10     ` Christian Brauner
2022-06-21 14:14 ` [PATCH v2 2/8] fs: add two type safe mapping helpers Christian Brauner
2022-06-21 14:14 ` [PATCH v2 3/8] fs: use mount types in iattr Christian Brauner
2022-06-21 14:14 ` [PATCH v2 4/8] fs: introduce tiny iattr ownership update helpers Christian Brauner
2022-06-21 14:14 ` [PATCH v2 5/8] fs: port to " Christian Brauner
2022-06-21 14:14 ` [PATCH v2 6/8] quota: port quota helpers mount ids Christian Brauner
2022-06-21 14:14 ` [PATCH v2 7/8] security: pass down mount idmapping to setattr hook Christian Brauner
2022-06-21 14:14 ` [PATCH v2 8/8] attr: port attribute changes to new types Christian Brauner
2022-06-21 17:33   ` Linus Torvalds
2022-06-22  4:06     ` Christian Brauner
2022-06-23 20:48   ` Seth Forshee
2022-06-23 21:03     ` Christian Brauner
2022-06-23 21:01 ` Seth Forshee [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=YrTUj0skph2MYTHH@do-x1extreme \
    --to=sforshee@digitalocean.com \
    --cc=brauner@kernel.org \
    --cc=cyphar@cyphar.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.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;
as well as URLs for NNTP newsgroup(s).