feat(suidhelper): chroot-jail grant-api op to hand the API socket to the node#45
Merged
Conversation
…the node The jailer drops firecracker to a per-VM uid/gid and chroots it, so the node user (a different uid) gets EACCES connecting to the API socket the jailer leaves at <jail>/root/api.socket owned by the per-VM id. This new op chowns just that socket to the helper's caller and chmods it 0660, and opens the parent root dir to the caller's group (chgrp + 0710) so the node can traverse into it -- per-VM isolation otherwise untouched. Security: the socket is validated as a SafePath reached by an O_NOFOLLOW walk from JAIL_BASE, every op is fd-relative on the pinned root fd, the leaf must be exactly <exec>/<id>/root/api.socket and fstatat(AT_SYMLINK_NOFOLLOW) must report a socket -- a planted file or symlink is refused, never touched. A missing socket anywhere on the path is Pending (firecracker not up yet), not an error. Adds the SafeDir stat/chmod/chmod_self/chgrp_self primitives this needs. Nothing on main invokes the op yet; the FireVMM caller lands with the boot path.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This was referenced Jun 30, 2026
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.
No description provided.