criu restore: defer /proc setup for userns with shared mntns#2879
Open
Krishna-cell-12 wants to merge 1 commit into
Open
criu restore: defer /proc setup for userns with shared mntns#2879Krishna-cell-12 wants to merge 1 commit into
Krishna-cell-12 wants to merge 1 commit into
Conversation
Signed-off-by: Krishna Sujit Abhang <krishnaabhang2022@gmail.com>
Member
|
Have you tried to run tests? |
Author
Member
|
@Krishna-cell-12 it fails in my environment and it fails in CI jobs [1]. You can try to run [1] https://app.circleci.com/jobs/github/checkpoint-restore/criu/7453 |
|
A friendly reminder that this PR had no activity for 30 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Restore fails with:
Unable to open the proc file system: Operation not permitted
when restoring a task that:
runs in a new user namespace, and
shares the host mount namespace.
CRIU attempts to open /proc too early, before the root task exists in the correct namespace context.
Solution
Detect root namespace configuration early using task namespace IDs.
Defer /proc opening in restore_root_task() when restoring:
CLONE_NEWUSER without CLONE_NEWNS.
Install CR_PROC_FD_OFF after mount_proc() from the root task, where permissions are valid.
Changes
Added prepare_root_ns_mask() to derive root_ns_mask from root_item->ids.
Skipped early /proc setup for userns + shared mntns restores.
Ensured root task installs CR_PROC_FD_OFF post mount_proc() if deferred.
No changes to usernsd startup or RPC paths.
Testing
Reproduced failure described in #2597.
Verified restore succeeds without /proc permission errors.
Build and restore complete successfully.
Fixes: #2597