fix(sandbox): allow spec-guard reads in rootfs#6
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.
What This Fixes
This PR changes the
spec-guardbinary mode from execute-only (0111) to readable/executable (0555) in the sandbox image build paths.Why: staging KVM/nsjail execution failed before user code with
execve('/usr/local/bin/spec-guard') failed: Permission denied. A live pod-local chmod to0555made the same API e2e suite pass across Python, NumPy, Node, Bun JavaScript, Bun TypeScript, and Bash.How It Works
api/Dockerfile, the image path used by thecodeapi-sandbox-runnerGitHub image workflow.docker/Dockerfile.worker-sandboxandlauncher/Dockerfileso the older/local sandbox image paths stay consistent.spec-guardsmoke to execute the binary after applyingchmod 0555, matching the image mode.Branch Coverage
maine66f44fReview Focus
0555is acceptable forspec-guardin hardened KVM/nsjail mode.api/Dockerfile.Verification
Current head:
git diff --check-> passed.rg -n "chmod 0?111 /usr/local/bin/spec-guard|chmod 0?555 /usr/local/bin/spec-guard|chmod 0555 /tmp/spec-guard" .github/workflows/ci.yml docker/Dockerfile.worker-sandbox api/Dockerfile launcher/Dockerfile-> only0555matches in the changed paths.Earlier staging evidence:
255.execve('/usr/local/bin/spec-guard') failed: Permission denied.chmod 0555 /sandbox-rootfs/usr/local/bin/spec-guardon staging runner, then/tmp/codeapi-e2e.mjs-> 11/11 passed.Not run:
gcc -O2 -static -Wall -Wextra -Werror -o /tmp/spec-guard api/src/spec-guard.con macOS host -> failed because Linux headersys/prctl.his unavailable. GitHub Linux CI should cover this.Security / Privacy
Blocking Before Merge
None.
Follow-Up After Merge
Build CodeAPI Imagespublish the updatedcodeapi-sandbox-runnerimage frommain./tmp/codeapi-e2e.mjswithout the live pod chmod.