tech-toolchain archive

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

Re: Fixing $ORGIN RPATHs - at least some of them



On Sun, Nov 05, 2017 at 11:46:15PM +0000, Christos Zoulas wrote:

> >I propose to use sysctl(2) with KERN_PROC_PATHNAME.

We can make that available as an alias for the procfs code with 
a few lines of code.

> Which means that if vnode_to_path() failed for the text vnode of the
> program during exec, it will also fail later sysctl or procfs :-)

I don't fully understand this point. We do not try vnode_to_path() for
the name currently (AFAICT).

> Instead of doing trying userland kludges to find the pathname (that don't
> really work -- after all if the kernel does not know, userland can only
> guess), we should fix the kernel so that it is recorded properly.

The point is that the kernel currently does a good job when it is easy
and nothing at all when not. That is fine, most of the time the additional
work will not be needed ever.

But now if userland *knows* it will need the additional data, it can
ask the kernel to try harder (and I don't care if that is via sysctl or
procfs).

Looking at the procfs code it seems that it would fail whenever a __getcwd(2)
would fail - and in the context of $ORIGIN I find this an acceptable 
restriction (after removing the obvious and simple limits like lengths and
nullfs).

Martin


Home | Main Index | Thread Index | Old Index