-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to restore a small code in user namespace #2597
Comments
What OS do you use. We have seen problems with Ubuntu 24.04 because of
Not sure that this related. Probably not. But worth a try. Also, is that CRIU from Ubuntu? The 3.16 that Ubuntu shipped was broken and they refused to fix it. Try with the latest version that we provide (either PPA or OBS, see the wiki for a way to get binaries). Why are you using |
this criu is the clone of thise repo latest one and i am trying make a simple program which will output only 'running'
then make it run in a different user namespace then dump that process (main.c compiled executable) then try to restore it which creates a problem and the reason i am using criu-ns because of this docs if i use the regular ones( ./criu/criu/criu) then also it gets the same output |
You are dumping a process in a separate userns but it is in the current mount namespace. I think we never consider that case. CRIU is trying to map the proc file system from the restored user ns and it fails because it doesn't have the required capabilities in the host user namespace where the mount namespace belongs to. First, we need to check why it is trying to mount the proc file system. If it is really required, we need to mount it from the host userns. If I remember right, the usernsd that can be used for that. |
@avagin Hi, i'm considering participating in GSOC 2025 for CRIU project, so i'm currently learning this codebase and happened to stumple upon this issue and working to solve this. So here's some insights on it. and I'm planning to fix this issue.
Somehow, the cflags which is the clone flags is propagated into the
So i guess it does not have the privilege to do the proc mount.
Yes, i believe usernsd can do this job because it's on the host side. We can leverage that to perform mount_proc for the forked child and restoring job should be then working but i'm not sure whether other privileged calls might be affected by this corner case. I tried to perform a trivial fix by clearing the NEWUSER flag in the clone flags but still it seems other actions are also rejected by the kernel. Are there more stuffs or privileged calls that i may look into? I don't think this issue is trivial to fix so i'm planning to do some more research on the code base also for my potential GSOC participation. |
@chamber909 @avagin should be fixed in #2600. Please check if there is something that i might overlook. Thanks :-) |
Code i wrote:
Ran in new user namespace:
for dumping :
dump log :
for restore :
restore log:
why its showing restoring failed???
The text was updated successfully, but these errors were encountered: