{{ message }}
Repository navigation
Conversation
Contributor
Author
When setgroups(2) is denied in the container user namespace (e.g. when runc is run inside "unshare -r", or the container joins such a user namespace), runc silently skipped setting the supplementary groups, so a container (or exec) explicitly configured with additional gids started successfully without them. Return an error instead. An additional gid equal to the process gid is tolerated, as it is in effect anyway; this is what Podman passes when running with a single ID mapping. The old comment about not being explicitly asked to set the groups is no longer true, since additional groups only come from the spec. The rootless EUID case is already rejected earlier, in (*Container).start. Reported-in: containers/crun#2320 Assisted-by: Claude Code (claude-opus-5-5) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin
force-pushed
the
setgroups-deny-gids
branch
from
October 19, 2026 06:04
c171362 to
c2763ab
Compare
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.

When
setgroups(2)is denied in the container user namespace (e.g. when runcis run inside
unshare -r, or the container joins such a user namespace), runcsilently skipped setting the supplementary groups, so a container (or exec)
explicitly configured with additional gids started successfully without them.
Return an error instead. An additional gid equal to the process gid is
tolerated, since it is in effect anyway; this is what Podman passes when running
with a single ID mapping (it always adds the user's primary gid), so that setup
keeps working.
The rootless EUID case is already rejected earlier, in
(*Container).start.The new integration test creates an external user namespace with setgroups
denied, joins it, and checks both
runc runandrunc exec. It is written toalso pass with crun (with containers/crun#2321).
Originally reported for crun in containers/crun#2320; crun counterpart is
containers/crun#2321.