Skip to content

linux: run createContainer hooks after mounts are set up - #2168

Open
giuseppe wants to merge 1 commit into
containers:mainfrom
giuseppe:fix-oci-hooks-order
Open

linux: run createContainer hooks after mounts are set up#2168
giuseppe wants to merge 1 commit into
containers:mainfrom
giuseppe:fix-oci-hooks-order

Conversation

@giuseppe

@giuseppe giuseppe commented Aug 6, 2026

Copy link
Copy Markdown
Member

PR #2094 moved libcrun_set_mounts after pivot_root but left the createContainer hooks before both, so they ran before /proc and other mounts existed, violating the OCI spec and breaking the NVIDIA Container Toolkit.

Add create_container_len to can_use_open_tree_namespace() so the deferred-pivot path is used, and move the hooks to run after libcrun_set_mounts and before the pivot in libcrun_finalize_mounts.

Fixes: #2167

PR containers#2094 moved libcrun_set_mounts after pivot_root but left the
createContainer hooks before both, so they ran before /proc and other
mounts existed, violating the OCI spec and breaking the NVIDIA Container
Toolkit.

Add create_container_len to can_use_open_tree_namespace() so the
deferred-pivot path is used, and move the hooks to run after
libcrun_set_mounts and before the pivot in libcrun_finalize_mounts.

Fixes: containers#2167

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe

giuseppe commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

@jnovy PTAL

@jnovy

jnovy commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

LGTM

@giuseppe

giuseppe commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

@henry118 could you verify if it solves your issue?

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.

createContainer hooks run before mounts are set up, violating OCI runtime spec

2 participants