chroot when no mount namespaces is provided#1702
chroot when no mount namespaces is provided#1702mrunalp merged 1 commit intoopencontainers:masterfrom
Conversation
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
|
I think this behaviour should be mentioned in the (Linux) spec, but I do think it is totally reasonable, if you dont specify a mount namespace, still making the root of the filesystem the rootfs seems sane, as hardly anything would work otherwise, if it was still the system root. For a start you would not even be in the right directory, and paths would not be useful, and you would have no way of knowing what the mountpoint of the rootfs was. So in favour of this, even if use cases are quite niche. |
+1 for this. The spec also does not cover runc's |
|
LGTM, though I would like to have this clarified in the spec -- and also we should generally dissuade people from using this (as we all know, It should also be noted that the current behaviour of |
|
ya, good luck waiting for that pivot root change to happen ;) I'll think about a good way to word this in the spec but in the meantime I think this change is safer than what happens today of the rootfs code does not run and we get placed in the host root, ignoring |
|
@crosbymichael Yup, I completely agree. |
|
What is the usecase of this? |
@cyphar Why? (EDIT: I noticed the actual |
|
@AkihiroSuda My view on that has flipped since I wrote the comment -- it turns out that the man page is more than a decade old and was written before |
We shouldn't skip the rootfs code when NEWNS is not specified because it will place the process in the host's
/, instead, perform a simplechrootso that the process is still placed inside the specified rootfs.Signed-off-by: Michael Crosby crosbymichael@gmail.com