Repository navigation
Privileged mode fuse-only supports buildkit-based container building - #9612
Merged
Merged
Conversation
…support oci-build-task Signed-off-by: Kump3r <[email protected]>
fuse-only supports buildkit-based container building
Member
|
Re-labelled as an |
taylorsilva
approved these changes
Jun 22, 2026
taylorsilva
left a comment
Member
There was a problem hiding this comment.
This LGTM. I locally tested by adding CONCOURSE_CONTAINERD_PRIVILEGED_MODE: fuse-only to my worker. I tested the given example pipeline and a few other more complex Dockerfiles from our CI. They all built without issue.
Contributor
Author
|
Thanks for the quick review! Sorry I was wondering between bug and enhancement, but since most dockerfiles require run, I decided on bug. |
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
The fuse-only privileged mode introduced in #9017 does not work with
oci-build-taskor any BuildKit-based image build. Any Dockerfilecontaining a
RUNstep fails with:runc run failed: unable to start container process: error spawning
mount remapping thread: mount source thread: join container mntns:
setns: operation not permitted
This is because BuildKit's runc needs to join the container's mount
namespace for each
RUNstep, which requiressetns— a syscall notpresent in the fuse-only allowlist.
Changes
Added three syscalls to
fuse_syscallsinworker/runtime/spec/seccomp.go:setns— scoped to mount namespaces only viaOpEqualTo CLONE_NEWNS(arg index 1). This allows runc to join mount namespaces for build steps
without permitting user namespace joins, which would be the dangerous
escalation path.
keyctl— needed by runc container init to create and configure asession keyring. Kernel keyrings are session-scoped and cannot affect
the host or other container sessions.
sethostname— needed by runc container init. Operates within thecontainer's own UTS namespace.
Security verification
Tested inside a fuse-only privileged container after the change:
unshare --usersucceeds but producesCapEff: 0000000000000000—no capabilities gained
unshare --user sh -c "mount -t proc proc /tmp/x"— blocked, mountinside a user namespace is not permitted
mount -t proc proc /tmp/escape— blockedecho h > /proc/sysrq-trigger— blocked/proc/keysempty)setnsto user namespace blocked by argument filterThe known container escape vectors remain closed.
unshare --userispermitted by the existing fuse_syscalls list but is harmless — the
resulting user namespace has zero capabilities and cannot mount.
Testing
Verified end-to-end
oci-build-taskbuild with a Dockerfile containingRUN,COPY,ARG,WORKDIR,USER,ENTRYPOINTandLABELstepssucceeds under fuse-only mode. Only
RUNsteps were affected by themissing syscalls — all other Dockerfile instructions work without changes
as they do not spawn container processes via runc.
Pipeline used for the tests Before/After docker compose rebuild:
Note:
#9017was only tested withbuildah/podman. This change extendscompatibility to BuildKit-based workflows.