Re: [PATCH 05/12] f*xattr: allow O_PATH descriptors

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

 



On Thu, May 14, 2020 at 10:02 AM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>
> On Wed, May 13, 2020 at 12:04 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> >
> > Needs a Cc to linux-api and linux-man.
> >
> > On Tue, May 05, 2020 at 11:59:08AM +0200, Miklos Szeredi wrote:
> > > This allows xattr ops on symlink/special files referenced by an O_PATH
> > > descriptor without having to play games with /proc/self/fd/NN (which
> > > doesn't work for symlinks anyway).
> >
> > Do we even intent to support xattrs on say links?  They never wire up
> > ->listxattr and would only get them through s_xattr.  I'm defintively
> > worried that this could break things without a very careful audit.
>
> Why do you think listxattr is not wired up for symlinks?
>
> Xfs and ext4 definitely do have it, and it seems most others too:
>
> $ git grep -A10  "struct inode_operations.*symlink" | grep listxattr | wc -l
> 29

In any case, I'm dropping this patch for now.   The comment about
/proc/self/fd/NN not working is actually wrong; it does work despite
the target being a symlink: LOOKUP_FOLLOW only follows the magic
symlink in this case, not the symlink that is the target.  So it's
possible to get (set, remove, list) the xattr on an O_PATH descriptor
using

sprintf("/proc/self/fd/%i", procpath, sizeof(procpath));
getxattr(procpath, ...);

Thanks,
Miklos




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

  Powered by Linux