Re: [PATCH 3/4] proc: Point /proc/net at /proc/thread-self/net instead of /proc/self/net

From: Al Viro
Date: Thu Sep 29 2022 - 15:00:21 EST


On Thu, Sep 29, 2022 at 07:50:36PM +0100, Al Viro wrote:
> > https://lore.kernel.org/all/CADDKRnDD_W5yJLo2otWXH8oEgmGdMP0N_p7wenBQbh17xKGZJg@xxxxxxxxxxxxxx/
> >
> > in case anybody cares.
> >
> > I wonder if the fix is to replace the symlink with a hardcoded lookup
> > (ie basically make it *act* like a hardlink - we don't really support
> > hardlinked directories, but we could basically fake the lookup in
> > proc). Since the problem was AppArmor reacting to the name in the
> > symlink.
> >
> > Al added the participants so that he can say "hell no".
>
> What do you mean? Lookup on "net" in /proc returning what, exactly?
> What would that dentry have for ->d_parent?

Looking at that thread, it seems that <censored> "policy" would not be
satisfied with anything other than /proc/*/task/*/net being seen
as /proc/<something>/net. As in "cd there and /bin/pwd will tell you
tha you are in /proc/<some number>/net".

Which is insane, especially since the entire problem is due to wanting
that directory to be different for different threads...