Re: [PATCH 4/7] fuse: implement file attributes mask for statx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 29, 2025 at 08:24:42AM +0200, Miklos Szeredi wrote:
> On Thu, 21 Aug 2025 at 02:51, Darrick J. Wong <djwong@xxxxxxxxxx> wrote:
> >
> > From: Darrick J. Wong <djwong@xxxxxxxxxx>
> >
> > Actually copy the attributes/attributes_mask from userspace.
> 
> Some attributes should definitely not be copied (like MOUNT_ROOT,
> AUTOMOUNT).  This should probably be VFS responsibility to prevent
> messing with these.
> 
> I guess the others are okay, they can already be queried through one
> of the fileattr intefaces.  But think we should still have an explicit
> mask to prevent the server setting anything other than the currently
> defined attributes.

Ok, will do.  Thanks for the feedback!

Though unfortunately there isn't a pre-existing mask for "flags the vfs
will set for you" other than grepping:

fs/stat.c:121: * Fill in the STATX_ATTR_* flags in the kstat structure for properties of the
fs/stat.c:127:          stat->attributes |= STATX_ATTR_IMMUTABLE;
fs/stat.c:129:          stat->attributes |= STATX_ATTR_APPEND;
fs/stat.c:153:  stat->attributes_mask |= STATX_ATTR_WRITE_ATOMIC;
fs/stat.c:163:          stat->attributes |= STATX_ATTR_WRITE_ATOMIC;
fs/stat.c:201:          stat->attributes |= STATX_ATTR_AUTOMOUNT;
fs/stat.c:204:          stat->attributes |= STATX_ATTR_DAX;
fs/stat.c:206:  stat->attributes_mask |= (STATX_ATTR_AUTOMOUNT |
fs/stat.c:207:                            STATX_ATTR_DAX);
fs/stat.c:312:          stat->attributes |= STATX_ATTR_MOUNT_ROOT;
fs/stat.c:313:  stat->attributes_mask |= STATX_ATTR_MOUNT_ROOT;

So I guess that's (IMMUTABLE | APPEND | AUTOMOUNT | DAX | MOUNT_ROOT) ?

IMMUTABLE | APPEND seem to be captured in KSTAT_ATTR_VFS_FLAGS, so maybe
that just needs to include the last three, and then we can use it to
clear those bits from the fuse server's reply.

--D

> Thanks,
> Miklos
> 




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux