Skip to content

criu: let CRIU detect external bind mounts with a userns - #2463

Closed
giuseppe wants to merge 1 commit into
containers:mainfrom
giuseppe:fix-criu-userns
Closed

giuseppe wants to merge 1 commit into
containers:mainfrom
giuseppe:fix-criu-userns

Conversation

@giuseppe

Copy link
Copy Markdown
Member

A container with its own user namespace cannot create device nodes, so the devices are bind mounted from the host. CRIU was only told about the bind mounts listed in the configuration, so the checkpoint failed with:

mnt: ./dev/urandom doesn't have a proper root mount

If the container has a user namespace, enable the autodetection of external bind mounts on checkpoint and restore. Other containers keep the strict handling of the unlisted bind mounts.

Add a checkpoint/restore test with a user namespace.

A container with its own user namespace cannot create device nodes, so
the devices are bind mounted from the host.  CRIU was only told about
the bind mounts listed in the configuration, so the checkpoint failed
with:

  mnt: ./dev/urandom doesn't have a proper root mount

If the container has a user namespace, enable the autodetection of
external bind mounts on checkpoint and restore.  Other containers keep
the strict handling of the unlisted bind mounts.

Add a checkpoint/restore test with a user namespace.

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
@kolyshkin

Copy link
Copy Markdown
Collaborator

It's probably better to list those mounts explicitly (like it's done in mounts and masked_paths), rather than rely on CRIU autodetect.

Besides, if we want to enforce mount flags on restore rather than relying on what's in the image (like commit 6dfaa3e does), we need to add them explicitly on restore. I will show the code soon.

@kolyshkin

Copy link
Copy Markdown
Collaborator

I will show the code soon.

it was more than I hoped for so here's the alternative PR: #2465

@giuseppe

Copy link
Copy Markdown
Member Author

closed in favor of #2465

@giuseppe giuseppe closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants