From: Jeff Layton <jlayton@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
NeilBrown <neil@brown.name>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] statx: don't leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask
Date: Tue, 03 Nov 2026 06:40:18 -0500 [thread overview]
Message-ID: <e46f56d2031e2f20360f5dcf1e75364d7fda8d1b.camel@kernel.org> (raw)
In-Reply-To: <aumRSdyFm9WY56e4@infradead.org>
On Mon, 2026-11-02 at 23:46 -0800, Christoph Hellwig wrote:
> On Thu, Oct 29, 2026 at 12:20:27PM -0400, Jeff Layton wrote:
> > STATX_ATTR_CHANGE_MONOTONIC is kernel-internal. cp_statx() strips it
> > from stx_attributes but copies attributes_mask verbatim, so it leaks to
> > userland on filesystems that advertise it (nfs, ceph), e.g.
> > stx_attributes_mask = 0x8000000000b03000 on NFS.
> >
> > Mask it out of stx_attributes_mask too.
>
>
> This actually seems like useful information, any reason it is not
> reported? We'd probably want to renumber if for that, though.
>
Because we don't report the change attribute itself. There's no reason
to report whether it's monotonic if userspace can't get to it in the
first place.
> > tmp.stx_blocks = stat->blocks;
> > - tmp.stx_attributes_mask = stat->attributes_mask;
> > + tmp.stx_attributes_mask = stat->attributes_mask & ~STATX_ATTR_CHANGE_MONOTONIC;
>
> But if we want to keep internal only flags, they should have a mask
> defined next to the attributes intead of open coding specific ones here.
>
> And please avoid the overly long line as well.
Alrighty, I'll post a v2.
--
Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2026-11-03 11:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 16:20 Jeff Layton
2026-11-02 21:47 ` Jan Kara
2026-11-03 7:46 ` Christoph Hellwig
2026-11-03 11:40 ` Jeff Layton [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=e46f56d2031e2f20360f5dcf1e75364d7fda8d1b.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=brauner@kernel.org \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neil@brown.name \
--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
all inboxes | Powered by JetHome®