Skip to content

checkpoint: fix masked directories with a non-default root - #2239

Merged
giuseppe merged 1 commit into
containers:mainfrom
kolyshkin:cr-masked-paths
Sep 11, 2026
Merged

giuseppe merged 1 commit into
containers:mainfrom
kolyshkin:cr-masked-paths

Conversation

@kolyshkin

Copy link
Copy Markdown
Collaborator

A masked directory is a bind mount of a shared empty directory, which lives under the state root. As it is an external mount for CRIU, it is registered with a key which is the path of that directory, both on checkpoint and restore.

On checkpoint, container->context is not set, so the default state root is used instead of the one set by --root. As a result, restore fails with something like:

Error (criu/mount.c:3141): mnt: No mapping for 420:(null) mountpoint

This was broken since the shared empty directory is registered with CRIU (commit d8a88c0, which fixed the regression from 4004e5b, #1859), i.e. since crun 1.24. The crun tests did not catch this as they do not use masked paths; runc integration tests do (found in #2238).

Set container->context on checkpoint, like it is done for other operations, and add a test case.

Fixes: d8a88c0 ("criu: checkpoint correctly the shared empty directory path")

A masked directory is a bind mount of a shared empty directory, which
lives under the state root. As it is an external mount for CRIU, it is
registered with a key which is the path of that directory, both on
checkpoint and restore.

On checkpoint, container->context is not set, so the default state root
is used instead of the one set by --root. As a result, restore fails
with something like:

  Error (criu/mount.c:3141): mnt: No mapping for 420:(null) mountpoint

This was broken since the shared empty directory is registered with
CRIU (commit d8a88c0, fixing the regression from 4004e5b, PR containers#1859),
i.e. since crun 1.24. The crun tests did not catch this as they do not
use masked paths; runc integration tests do.

Set container->context on checkpoint, like it is done for other
operations, and add a test case.

Fixes: d8a88c0 ("criu: checkpoint correctly the shared empty directory path")
Signed-off-by: Kir Kolyshkin <[email protected]>

@giuseppe giuseppe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe
giuseppe merged commit a636dc8 into containers:main Sep 11, 2026
59 checks passed
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