On Thu, 2 Jul 2026 09:13:31 +0200
Mateusz Andrzejewski
For integrations, which use rootfs on tmpfs or initramfs, it is not allowed to use pivot_root(). It results with invalid argument (EINVAL) error. Introduce --chroot-fallback option as a workaround with MS_MOVE + chroot().
Due to weaker isolation of chroot() method (we don't unmount old root), user has tu explicitly enable fallback with the new option. First, always try to sandbox with pivot_root(). In both cases the new root is placed into an empty tmpfs.
For the solution to work we keep CAP_SYS_CHROOT capability, which is dropped at the end of the isolate_prefork() function.
Link: https://bugs.passt.top/show_bug.cgi?id=104
Signed-off-by: Mateusz Andrzejewski
Applied (with minor tweaks as discussed), thanks, and welcome to the git log! -- Stefano