Re: xattr names for unprivileged stacking?

Miklos Szeredi
2020-08-29T19:13:41Z

On Sat, Aug 29, 2020 at 8:04 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Sat, Aug 29, 2020 at 07:51:47PM +0200, Miklos Szeredi wrote:
> > On Sat, Aug 29, 2020 at 6:14 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> > >
> > > On Sat, Aug 29, 2020 at 05:07:17PM +0100, Matthew Wilcox wrote:
> > >
> >
> > > > > The fact that ADS inodes would not be in the dentry cache and hence
> > > > > not visible to pathwalks at all then means that all of the issues
> > > > > such as mounting over them, chroot, etc don't exist in the first
> > > > > place...
> > > >
> > > > Wait, you've now switched from "this is dentry cache infrastructure"
> > > > to "it should not be in the dentry cache". So I don't understand what
> > > > you're arguing for.
> > >
> > > Bloody wonderful, that. So now we have struct file instances with no dentry
> > > associated with them? Which would have to be taken into account all over
> > > the place...
> >
> > It could have a temporary dentry allocated for the lifetime of the
> > file and dropped on last dput. I.e. there's a dentry, but no cache.
> > Yeah, yeah, d_path() issues, however that one will have to be special
> > cased anyway.
>
> d_path() is the least of the problems, actually. Directory tree structure on
> those, OTOH, is a serious problem. If you want to have getdents(2) on that
> shite, you want an opened descriptor that looks like a directory. And _that_
> opens a large can of worms. Because now you have fchdir(2) to cope with,
> lookups going through /proc/self/fd/<n>/..., etc., etc.

Seriously, nobody wants fchdir(). And getdents() does not imply fchdir().

As for whether we'd need foobarat() on such a beast or let
/proc/self/fd/<n> be dereferenced, I think no. So comes the argument:
but then we'll break all those libraries and whatnot relying on these
constructs. Well, sorry, so would we if we didn't introduce this in
the first place. That's not really breaking anything, it's just
setting expectations.

Thanks,
Miklos