fix(oci): apply absolute symlink resolution to /etc/group#12925
Conversation
fuweid
left a comment
There was a problem hiding this comment.
Thanks. The change looks good. However, please add the UT to cover this case.
1176e7f to
a5bf049
Compare
Done! Added TestGroupLookup_AbsoluteSymlink covering both GIDFromFS and getSupplementalGroupsFromFS absolute symlink resolution. |
This is a follow-up to PR #12732. As noted by @TheColorman, while the previous PR successfully resolved absolute symlinks pointing outside the mount root for /etc/passwd during user lookups, the same logic was missing for group lookups. This caused `openat etc/group: path escapes from parent` errors when /etc/group was also an absolute symlink (e.g., in NixOS environments). This patch updates GIDFromFS, getSupplementalGroupsFromFS, and WithAppendAdditionalGroups to use the openUserFile helper, ensuring absolute symlinks are correctly re-anchored across all OCI user/group resolution paths. Includes unit test for validation. Fixes #12683 Signed-off-by: Paulo Oliveira <[email protected]>
b98247f to
fc406db
Compare
|
Thanks for this @pauloappbr MR tested on NixOS - NixOS/nixpkgs#482748 (comment) and runs fine. (In NixOS we can add patches (commits/MRs) to packages in a simple way, and have a rather powerful test system to test packages with) BR |
|
Is it possible to get a extra review on this from somebody with write access? We and others are stuck on older versions of contained because of this change in go. |
|
@eskytthe Which version do you use exactly? We have the same problem on our Nix-based continuous integration and if I can downgrade to a reasonable working version it could help a lot. |
|
@samuelkarp can you please help? |
@AllanBlanchard we use 2.1.5 for our k8s setup - runs well (think it was standard in nixos 25.05). Overlay included if you can use it. Note containerd ver. 2.2.2 was released yesterday - but yes it do not include this /etc/group fix. |
|
ping @samuelkarp @mxpv @AkihiroSuda |
|
/cherry-pick release/2.2 |
|
@AkihiroSuda: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@AkihiroSuda: new pull request created: #13019 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hi @austinvazquez, could you please confirm if this was cherry-picked to 2.2.x? I don't see it in the commit history |
|
@Harjappan-Singh Look at #13019. You can see it was merged March 12, but the last 2.2 was release March 10. It's in the branch, but not released yet. |
This is a follow-up to PR #12732.
As noted by @TheColorman, while the previous PR successfully resolved absolute symlinks pointing outside the mount root for
/etc/passwdduring user lookups, the same logic was missing for group lookups. This causedopenat etc/group: path escapes from parenterrors when/etc/groupwas also an absolute symlink (e.g., in NixOS environments).This patch updates
GIDFromFS,getSupplementalGroupsFromFS, andWithAppendAdditionalGroupsto use theopenUserFilehelper, ensuring absolute symlinks are correctly re-anchored across all OCI user/group resolution paths.Fixes #12683
Signed-off-by: Paulo Oliveira [email protected]