From: Christoph Hellwig <hch@infradead.org>
To: Jeff Layton <jlayton@kernel.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: Mon, 2 Nov 2026 23:46:17 -0800 [thread overview]
Message-ID: <aumRSdyFm9WY56e4@infradead.org> (raw)
In-Reply-To: <20261029-statx-v1-1-9600cdb896b3@kernel.org>
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.
> 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.
next prev parent reply other threads:[~2026-11-03 7:46 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 [this message]
2026-11-03 11:40 ` Jeff Layton
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=aumRSdyFm9WY56e4@infradead.org \
--to=hch@infradead.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--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®