linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC][PATCH] getname_maybe_null() - the third variant of pathname copy-in
Date: Mon, 21 Oct 2024 23:43:13 +0100	[thread overview]
Message-ID: <20241021224313.GC1350452@ZenIV> (raw)
In-Reply-To: <20241021170910.GB1350452@ZenIV>

On Mon, Oct 21, 2024 at 06:09:10PM +0100, Al Viro wrote:
> On Mon, Oct 21, 2024 at 02:39:58PM +0200, Christian Brauner wrote:
> 
> > > See #getname.fixup; on top of #base.getname and IMO worth folding into it.
> > 
> > Yes, please fold so I can rebase my series on top of it.
> 
> OK...  What I have is #base.getname-fixed, with two commits - trivial
> "teach filename_lookup() to accept NULL" and introducing getname_maybe_null(),
> with fix folded in.
> 
> #work.xattr2 and #work.statx2 are on top of that.

BTW, speaking of statx() - I would rather lift the call of cp_statx() out
of do_statx() and do_statx_fd() into the callers.  Yes, that needs making
it non-static, due to io_uring; not a problem, IMO - it fits into the
"how do we copy internal objects to userland ones" family of helpers.

Another fun issue: for by-pathname case vfs_fstatat() ends up hitting
the same vfs_statx_path() as statx(2); however, for by-descriptor case
they do vfs_getattr() and vfs_statx_path() resp.

The difference is, vfs_statx_path() has
        if (request_mask & STATX_MNT_ID_UNIQUE) {
                stat->mnt_id = real_mount(path->mnt)->mnt_id_unique;
                stat->result_mask |= STATX_MNT_ID_UNIQUE;
        } else {
                stat->mnt_id = real_mount(path->mnt)->mnt_id;
                stat->result_mask |= STATX_MNT_ID;
        }

        if (path_mounted(path))
                stat->attributes |= STATX_ATTR_MOUNT_ROOT;
        stat->attributes_mask |= STATX_ATTR_MOUNT_ROOT;

        /*
         * If this is a block device inode, override the filesystem
         * attributes with the block device specific parameters that need to be
         * obtained from the bdev backing inode.
         */
        if (S_ISBLK(stat->mode))
                bdev_statx(path, stat, request_mask);
done after vfs_getattr().  Questions:

1) why is STATX_MNT_ID set without checking if it's in the mask passed to
the damn thing?

2) why, in the name of everything unholy, does statx() on /dev/weird_shite
trigger modprobe on that thing?  Without even a permission check on it...

  reply	other threads:[~2024-10-21 22:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  4:03 [RFC][PATCH] getname_maybe_null() - the third variant of pathname copy-in Al Viro
2024-10-15 14:05 ` Christian Brauner
2024-10-16  5:09   ` Al Viro
2024-10-16  8:32     ` Christian Brauner
2024-10-16 14:00       ` Al Viro
2024-10-16 14:49         ` Christian Brauner
2024-10-17 23:54           ` Al Viro
2024-10-18 11:06             ` Christian Brauner
2024-10-18 16:51               ` Al Viro
2024-10-18 19:38                 ` Al Viro
2024-10-19  5:03                   ` Al Viro
2024-10-19 16:15                     ` Linus Torvalds
2024-10-19 17:11                       ` Al Viro
2024-10-19 17:27                         ` Linus Torvalds
2024-10-21 12:38                         ` Christian Brauner
2024-10-21 12:39                     ` Christian Brauner
2024-10-21 17:09                       ` Al Viro
2024-10-21 22:43                         ` Al Viro [this message]
2024-10-22  8:49                           ` Christian Brauner
2024-10-30  6:37                             ` Al Viro
2024-10-21 12:47                   ` Christian Brauner
2024-10-21 17:05                     ` Al Viro
2024-10-21 12:36                 ` 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=20241021224313.GC1350452@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).