lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251103192801.GA196391@frogsfrogsfrogs>
Date: Mon, 3 Nov 2025 11:28:01 -0800
From: "Darrick J. Wong" <djwong@...nel.org>
To: Joanne Koong <joannelkoong@...il.com>
Cc: miklos@...redi.hu, bernd@...ernd.com, neal@...pa.dev,
	linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 3/5] fuse: implement file attributes mask for statx

On Mon, Nov 03, 2025 at 10:43:10AM -0800, Joanne Koong wrote:
> On Mon, Nov 3, 2025 at 10:30 AM Joanne Koong <joannelkoong@...il.com> wrote:
> >
> > > diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
> > > index a8068bee90af57..8c47d103c8ffa6 100644
> > > --- a/fs/fuse/fuse_i.h
> > > +++ b/fs/fuse/fuse_i.h
> > > @@ -140,6 +140,10 @@ struct fuse_inode {
> > >         /** Version of last attribute change */
> > >         u64 attr_version;
> > >
> > > +       /** statx file attributes */
> > > +       u64 statx_attributes;
> > > +       u64 statx_attributes_mask;
> > > +
> > >         union {
> > >                 /* read/write io cache (regular file only) */
> > >                 struct {
> > > @@ -1235,6 +1239,39 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr,
> > >                                    u64 attr_valid, u32 cache_mask,
> > >                                    u64 evict_ctr);
> > >
> > > +/*
> > > + * These statx attribute flags are set by the VFS so mask them out of replies
> > > + * from the fuse server for local filesystems.  Nonlocal filesystems are
> > > + * responsible for enforcing and advertising these flags themselves.
> > > + */
> > > +#define FUSE_STATX_LOCAL_VFS_ATTRIBUTES (STATX_ATTR_IMMUTABLE | \
> > > +                                        STATX_ATTR_APPEND)
> >
> > for STATX_ATTR_IMMUTABLE and STATX_ATTR_APPEND, I see in
> > generic_fill_statx_attr() that they get set if the inode has the
> > S_IMMUTABLE flag and the S_APPEND flag set, but I'm not seeing how
> > this is relevant to fuse. I'm not seeing anywhere in the vfs layer
> > that sets S_APPEND or STATX_ATTR_IMMUTABLE, I only see specific
> > filesystems setting them, which fuse doesn't do. Is there something
> > I'm missing?
> 
> Ok, I see. In patchset 6/8 patch 3/9 [1],
> FUSE_ATTR_SYNC/FUSE_ATTR_IMMUTABLE/FUSE_ATTR_APPEND flags get added
> which signify that S_SYNC/S_IMMUTABLE/S_APPEND should get set on the

<nod>  Originally I was going to hide /all/ of this behind the
per-fuse_inode iomap flag, but the Miklos and I started talking about
having a separate "behaves like local fs" flag for a few things so that
non-iomap fuseblk servers could take advantage of them too.  Right now
it's limited to these vfs inode flags and the posix acl transformation
functions since the assumption is that a regular fuse server either does
the transformations on its own or forwards the request to a remote node
which (presumably if it cares) does the transformation on its own.

> inode.  Hmm I'm confused why we would want to mask them out for local
> filesystems. If FUSE_ATTR_SYNC/FUSE_ATTR_IMMUTABLE/FUSE_ATTR_APPEND
> are getting passed in by the fuse server and getting enforced, why
> don't we want them to show up in stax?

We do, but the VFS sets those statx flags for us:
https://elixir.bootlin.com/linux/v6.17.7/source/fs/stat.c#L124

--D

> Thanks,
> Joanne
> 
> [1] https://lore.kernel.org/linux-fsdevel/176169811656.1426244.11474449087922753694.stgit@frogsfrogsfrogs/
> >
> > Thanks,
> > Joanne

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ