Skip to content

Reject unrepresentable sandbox resource limits - #735

Merged
Pedro Henrique Penna (ppenna) merged 2 commits into
microsoft:devfrom
jay23606:pr-go/733-track-sandbox-resource-limit-bugs-memory
Oct 21, 2026
Merged

Pedro Henrique Penna (ppenna) merged 2 commits into
microsoft:devfrom
jay23606:pr-go/733-track-sandbox-resource-limit-bugs-memory

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

Bug

Sandbox launches accepted memory limits above the guest cgroup's unsigned 64-bit range and PID limits that become invalid after adding the init process. Oversized memory limits can wrap, while oversized PID limits stop guest boot.

Change

Validate both limits in SandboxLaunch so CLI and library callers are refused values the guest cannot apply.

Testing

cargo test --lib host::sandbox::tests::launch_rejects_limits_the_guest_cgroup_cannot_store failed on the unfixed code with the oversized memory limit accepted, then passed after the validation was added.

Regression test: tested and passed.

Fixes #733

@jay23606

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Copilot AI balanced review requested due to automatic review settings October 21, 2026 20:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Existing golden fixtures conflict with the new validation and must be updated to prevent test failures.

1 open issue

Review effort: Balanced

Comment thread nvx-rs/src/host/sandbox/mod.rs Outdated
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 20:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track sandbox resource limit bugs: --memory-max wraps modulo 2^64, large --pids-max fails boot

3 participants