Fix jail permission setup for non-root runners - #106
Merged
Merged
Conversation
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.
A non-root microVM runner with the documented capability set could not prepare its jail: ownership moved to the VM uid before
chmod, which then failed withEPERM. Reclaim the inode withCAP_CHOWN, set its mode while owned by the runner, and transfer it to the VM. The same sequence handles an inode retained across resume without addingCAP_FOWNER. An engine ownership mutex keeps concurrent launches from interleaving the sequence through hard links to the same home inode.A real Linux regression launches a non-root child with only
CAP_CHOWNand checks initial setup, repeated ownership transfer, and concurrent shared-inode transfers. It failed before the fix and passes after it; Linux CI now runs it explicitly. Focused jail tests pass, the Linux concurrency regression passed ten repetitions, and full CI passed for commit 2983175 (make verify, restricted-capability regression, and CLI/client race checks). Both independent reviews pass after fixing the adversarial concurrency finding.The privileges document records a separate unresolved limitation: jailer 1.17.0 writes ancestor cgroup controls outside a delegated subtree. This PR fixes inode ownership; it does not qualify the complete non-root launch path or change the capability set.