Skip to contentSkip to conversation

/proc/1/exe entry of PID namespace init process links to wrong executable

Bug 12199 robert.rex-GD4dBWQXeU/[email protected] 2 participants 2 messages Dec 15, 2008 3 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
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_path to honor current->fs->root because 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

#4 lore raw
In reply to a message not in the archive
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}/exe link 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