/proc/1/exe entry of PID namespace init process links to wrong executable
Quoted 5 lines · ebiederm-aS9lmoZGLiVWk0Htik3J/[email protected] wrote:
http://bugzilla.kernel.org/show_bug.cgi?id=12199
[...]
You specified NEWNS in your clone flags, creating a new mount namespace as well.
Quoted 7 lines
Your executable came from a different mount namespace and thus has a different set of mounts. Which defeats the logic in
d_pathto honorcurrent->fs->rootbecause your executable came from a different universe.No bugs here just weird corner cases with the mount namespace.
Eric
Thanks for your analysis! That sounds reasonable (I didn't recognize the use of CLONE_NEWNS - just pasting from the examples ;-) - but I needed it to mount a proc filesystem in the new PID namespace while using the other one "outside"). So, I may not count on the /proc/{PID}/exe link anymore in such cases as far as I see.
Robert
Quoted 5 lines · robert.rex-GD4dBWQXeU/[email protected] writes:
Thanks for your analysis! That sounds reasonable (I didn't recognize the use of
CLONE_NEWNS- just pasting from the examples ;-) - but I needed it to mount a proc filesystem in the new PID namespace while using the other one "outside"). So, I may not count on the/proc/{PID}/exelink anymore in such cases as far as I see.
Just setup the mount namespace instead of setting up a chroot and all will be well.
Eric