Re: [PATCH v2 2/4] fs: add FS_IOC_FSSETXATTRAT and FS_IOC_FSGETXATTRAT

Amir Goldstein
2024-05-22T19:04:08Z

On Wed, May 22, 2024 at 7:38 PM Eric Biggers <ebiggers@kernel.org> wrote:
>
> On Wed, May 22, 2024 at 09:28:53AM -0700, Darrick J. Wong wrote:
> >
> > Do the other *at() syscalls prohibit dfd + path pointing to a different
> > filesystem? It seems odd to have this restriction that the rest don't,
> > but perhaps documenting this in the ioctl_xfs_fsgetxattrat manpage is ok.
>
> No, but they are arbitrary syscalls so they can do that. ioctls traditionally
> operate on the specific filesystem of the fd.

To emphasize the absurdity
think opening /dev/random and doing ioctl to set projid on some xfs file.
It is ridiculous.

>
> It feels like these should be syscalls, not ioctls.
>

I bet whatever name you choose for syscalls it is going to be too
close lexicographically to [gs]etxattrat(2) [1]. It is really crowded
in the area of getattr/getfattr/fgetxattr/getxattr/getfileattr/getfsxattr...
I think I would vote for [gs]etfsxattrat(2) following the uapi struct fsxattr.
I guess we have officially spiralled.

Thanks,
Amir.

[1] https://lore.kernel.org/linux-fsdevel/20240426162042.191916-1-cgoettsche@seltendoof.de/