From: Trond Myklebust <trondmy@hammerspace.com>
To: "brauner@kernel.org" <brauner@kernel.org>,
"paul@paul-moore.com" <paul@paul-moore.com>
Cc: "jack@suse.cz" <jack@suse.cz>,
"mic@digikod.net" <mic@digikod.net>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"anna@kernel.org" <anna@kernel.org>,
"linux-security-module@vger.kernel.org"
<linux-security-module@vger.kernel.org>,
"audit@vger.kernel.org" <audit@vger.kernel.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>
Subject: Re: [RFC PATCH v1 1/7] fs: Add inode_get_ino() and implement get_ino() for NFS
Date: Thu, 17 Oct 2024 14:30:38 +0000 [thread overview]
Message-ID: <5bbddc8ba332d81cbea3fce1ca7b0270093b5ee0.camel@hammerspace.com> (raw)
In-Reply-To: <CAHC9VhRd7cRXWYJ7+QpGsQkSyF9MtNGrwnnTMSNf67PQuqOC8A@mail.gmail.com>
On Wed, 2024-10-16 at 19:05 -0400, Paul Moore wrote:
> On Wed, Oct 16, 2024 at 10:23 AM Christian Brauner
> <brauner@kernel.org> wrote:
> >
> > On Thu, Oct 10, 2024 at 05:26:41PM +0200, Mickaël Salaün wrote:
> > > When a filesystem manages its own inode numbers, like NFS's
> > > fileid shown
> > > to user space with getattr(), other part of the kernel may still
> > > expose
> > > the private inode->ino through kernel logs and audit.
> > >
> > > Another issue is on 32-bit architectures, on which ino_t is 32
> > > bits,
> > > whereas the user space's view of an inode number can still be 64
> > > bits.
> > >
> > > Add a new inode_get_ino() helper calling the new struct
> > > inode_operations' get_ino() when set, to get the user space's
> > > view of an
> > > inode number. inode_get_ino() is called by generic_fillattr().
> > >
> > > Implement get_ino() for NFS.
> > >
> > > Cc: Trond Myklebust <trondmy@kernel.org>
> > > Cc: Anna Schumaker <anna@kernel.org>
> > > Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> > > Cc: Christian Brauner <brauner@kernel.org>
> > > Cc: Jan Kara <jack@suse.cz>
> > > Signed-off-by: Mickaël Salaün <mic@digikod.net>
> > > ---
> > >
> > > I'm not sure about nfs_namespace_getattr(), please review
> > > carefully.
> > >
> > > I guess there are other filesystems exposing inode numbers
> > > different
> > > than inode->i_ino, and they should be patched too.
> >
> > What are the other filesystems that are presumably affected by this
> > that
> > would need an inode accessor?
>
> I don't want to speak for Mickaël, but my reading of the patchset was
> that he was suspecting that other filesystems had the same issue
> (privately maintained inode numbers) and was posting this as a RFC
> partly for clarity on this from the VFS developers such as yourself.
>
> > If this is just about NFS then just add a helper function that
> > audit and
> > whatever can call if they need to know the real inode number
> > without
> > forcing a new get_inode() method onto struct inode_operations.
>
> If this really is just limited to NFS, or perhaps NFS and a small
> number of filesystems, then a a helper function is a reasonable
> solution. I think Mickaël was worried that private inode numbers
> would be more common, in which case a get_ino() method makes a bit
> more sense.
>
> > And I don't buy that is suddenly rush hour for this.
>
> I don't think Mickaël ever characterized this as a "rush hour" issue
> and I know I didn't. It definitely caught us by surprise to learn
> that inode->i_no wasn't always maintained, and we want to find a
> solution, but I'm not hearing anyone screaming for a solution
> "yesterday".
>
> > Seemingly no one noticed this in the past idk how many years.
>
> Yet the issue has been noticed and we would like to find a solution,
> one that is acceptable both to the VFS and LSM folks.
>
> Can we start with compiling a list of filesystems that maintain their
> inode numbers outside of inode->i_no? NFS is obviously first on that
> list, are there others that the VFS devs can add?
>
Pretty much any filesystem that uses 64-bit inode numbers has the same
problem: if the application calls stat(), 32-bit glibc will happily
convert that into a call to fstatat64() and then cry foul if the kernel
dares return an inode number that doesn't fit in 32 bits.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2024-10-17 14:30 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 15:26 [RFC PATCH v1 1/7] fs: Add inode_get_ino() and implement get_ino() for NFS Mickaël Salaün
2024-10-10 15:26 ` [RFC PATCH v1 2/7] audit: Fix inode numbers Mickaël Salaün
2024-10-11 1:20 ` [PATCH RFC " Paul Moore
2024-10-11 1:38 ` Paul Moore
2024-10-11 21:34 ` [RFC PATCH " Paul Moore
2024-10-14 13:30 ` Mickaël Salaün
2024-10-14 23:36 ` Paul Moore
2024-10-10 15:26 ` [RFC PATCH v1 3/7] selinux: Fix inode numbers in error messages Mickaël Salaün
2024-10-11 1:20 ` [PATCH RFC " Paul Moore
2024-10-10 15:26 ` [RFC PATCH v1 4/7] integrity: Fix inode numbers in audit records Mickaël Salaün
2024-10-11 1:20 ` [PATCH RFC " Paul Moore
2024-10-11 10:15 ` Mickaël Salaün
2024-10-11 11:34 ` Roberto Sassu
2024-10-11 12:38 ` Mickaël Salaün
2024-10-11 12:45 ` Roberto Sassu
2024-10-10 15:26 ` [RFC PATCH v1 5/7] ipe: " Mickaël Salaün
2024-10-10 17:44 ` Fan Wu
2024-10-10 15:26 ` [RFC PATCH v1 6/7] smack: Fix inode numbers in logs Mickaël Salaün
2024-10-10 17:18 ` Casey Schaufler
2024-10-10 15:26 ` [RFC PATCH v1 7/7] tomoyo: " Mickaël Salaün
2024-10-12 7:35 ` [PATCH] tomoyo: use u64 for handling numeric values Tetsuo Handa
2024-10-14 13:59 ` Mickaël Salaün
2024-10-10 18:07 ` [RFC PATCH v1 1/7] fs: Add inode_get_ino() and implement get_ino() for NFS Anna Schumaker
2024-10-11 10:14 ` Mickaël Salaün
2024-10-10 19:28 ` Trond Myklebust
2024-10-11 10:15 ` Mickaël Salaün
2024-10-11 12:22 ` Trond Myklebust
2024-10-11 12:38 ` Mickaël Salaün
2024-10-11 12:43 ` Mickaël Salaün
2024-10-11 10:12 ` Tetsuo Handa
2024-10-11 10:54 ` Tetsuo Handa
2024-10-11 11:10 ` Mickaël Salaün
2024-10-11 11:04 ` Mickaël Salaün
2024-10-11 14:27 ` Tetsuo Handa
2024-10-11 15:13 ` Christoph Hellwig
2024-10-11 15:26 ` Mickaël Salaün
2024-10-11 12:30 ` Christoph Hellwig
2024-10-11 12:47 ` Mickaël Salaün
2024-10-11 12:54 ` Christoph Hellwig
2024-10-11 13:20 ` Mickaël Salaün
2024-10-11 13:23 ` Christoph Hellwig
2024-10-11 13:52 ` Mickaël Salaün
2024-10-11 14:39 ` Christoph Hellwig
2024-10-11 15:30 ` Mickaël Salaün
2024-10-11 15:34 ` Christoph Hellwig
2024-10-14 14:35 ` Christian Brauner
2024-10-14 14:36 ` Christoph Hellwig
2024-10-13 10:17 ` Jeff Layton
2024-10-14 8:40 ` Burn Alting
2024-10-14 9:02 ` Christoph Hellwig
2024-10-14 12:12 ` Burn Alting
2024-10-14 12:17 ` Christoph Hellwig
2024-10-14 13:13 ` Mickaël Salaün
[not found] ` <9c3bc3b7-2e79-4423-b8eb-f9f6249ee5bf@iinet.net.au>
2024-10-14 10:22 ` Jeff Layton
2024-10-14 14:45 ` Christian Brauner
2024-10-14 15:27 ` Mickaël Salaün
2024-10-16 0:15 ` Paul Moore
2024-10-14 14:47 ` Christian Brauner
2024-10-14 17:51 ` Mickaël Salaün
2024-10-16 14:23 ` Christian Brauner
2024-10-16 23:05 ` Paul Moore
2024-10-17 14:30 ` Trond Myklebust [this message]
2024-10-17 14:54 ` Paul Moore
2024-10-17 14:58 ` Christoph Hellwig
2024-10-17 15:15 ` Paul Moore
2024-10-17 15:25 ` Christoph Hellwig
2024-10-17 16:43 ` Jan Kara
2024-10-18 5:15 ` Christoph Hellwig
2024-10-21 13:17 ` Christian Brauner
2024-10-17 17:05 ` Jeff Layton
2024-10-17 17:09 ` Trond Myklebust
2024-10-17 17:59 ` Jeff Layton
2024-10-17 21:06 ` Trond Myklebust
2024-10-18 5:18 ` hch
2024-10-17 20:21 ` Paul Moore
2024-10-18 12:25 ` Jan Kara
2024-10-21 13:13 ` Christian Brauner
2024-10-21 14:04 ` Christian Brauner
2024-10-17 14:56 ` Christoph Hellwig
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=5bbddc8ba332d81cbea3fce1ca7b0270093b5ee0.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=anna@kernel.org \
--cc=audit@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=paul@paul-moore.com \
--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).