Repository navigation
fix(box): allow startup while protecting inaccessible executable aliases - #343
Conversation
## Problem A Linux bind mount can expose an installed Box executable through a directory that the Box user cannot enter. The installation check aborts on that path's permission error, so unrelated workloads cannot start. Both managed-code and customer-container AgentCore Runtime deployments reproduce this failure. ## Solution Keep a permission-denied candidate in the protected alias list. Existing checks still reject writable grants and hosted mutations that overlap that path or its ancestors. Unrelated operations can proceed. Other inspection errors still refuse the check. An inaccessible candidate can protect an unrelated path conservatively until Box can inspect its identity. Extend the real mount regression test and update both installation reference pages. No public interface or foundational premise changes. ## Tests - an_unreadable_mapped_alias_is_protected_as_an_alias and real_mount_aliases_preserve_link_counts_and_refuse_overlapping_write_grants: both failed with the fix removed and passed after restoration, without skips. - The focused mount suite passed all 17 tests. The real mount case covers unrelated writes, agent/tool/MCP ancestor grants, hosted mutation refusals, and protection after directory permissions are restored. - AgentCore Runtime V2: all 27 checks passed in six current-main-plus-fix runs. Each deployment mode ran twice in one session and once in a fresh session. Tests include packaged launches, ordinary writes, and installation mutation refusals. The isolated original-merge comparison passed all 26 checks in six runs with the correction; the original merge failed 23 checks per mode. - Workspace build, formatting, and the repository's workspace clippy recipe passed. Box library tests passed 783/783; installation integration passed 8/8. - Initial just check failed in failed_agent_stops_detached_descendants because an unchanged test helper parsed an empty release file. The targeted rerun passed; the unchanged baseline helper reproduced the same empty-input panic. Two tests skipped for missing helper copies passed after the CI fixture setup. - Full workspace rerun, no-default-features build, examples, deterministic containment checks, and hosted platform checks remain incomplete at commit. This commit is prepared for draft review, not merge approval. Co-authored-by: Ravi Kandury <[email protected]>
|
Assessment: Comment The fix is narrow and closes the startup failure without weakening write protection. My two comments are about what the operator sees when the new arm causes a refusal, and about the new tests checking too loosely. Checked and held
The real-mount test also covers the case where permissions are restored, which is the important follow-through. |
|
The verification/testing isn't too clear What test was missing before and what test fails without this change now? |
|
Regression coverage for
The two nonblocking review refinements are deferred from this startup repair. Follow-up owner: @kevin-orellana.
The current correction retains conservative write protection. Missing-path handling remains unchanged. The example revision update is also separate and is not included in this PR. |
Human readable section
Problem: A Linux mount can expose an installed Box executable through a directory that the Box user cannot enter. The check added in #295 refuses every launch when inspection of that path returns permission denied. This blocks unrelated workloads, including non-root AgentCore Runtime deployments.
Solution: Retain the inaccessible path as a possible executable alias, meaning another path to the same file. Box still rejects writable grants and file changes that could modify that path or its enclosing directories. Workloads that write elsewhere can start.
Trade-off: An inaccessible candidate can point to a different file. Box protects it conservatively, so an overlapping write can still be refused. Unexpected inspection errors and unstable mount tables still refuse the check.
Description
Keep permission-denied candidates in the Linux installation protection list. The existing grant and hosted Shell/Python checks then protect those paths.
The real mount test hides a second executable path behind a directory that the test process cannot enter. While inspection fails, unrelated sibling grants remain usable. The test rejects enclosing write grants for the agent, tools, and Model Context Protocol (MCP) servers. It also checks the protection that Shell/Python apply to enclosing-path changes. After directory permissions are restored, it rejects a direct write grant and a change to the executable path. The installation documentation describes this behavior.
The core correction comes from Ravi Kandury's proposed fix. This PR includes AI-assisted implementation, tests, source review, and prose. Human review remains pending.
Related Issues
Follow-up to #295.
Type of Change
Bug fix
Testing
a4a4645a4a4645plus the four-line correction57ee0b2(parent6097aed)57ee0b2.57ee0b2The isolated correction and newer-main integration checks use different source revisions. The isolated Runtime results do not establish final-commit qualification. The newer-main Runtime package contains the exact source change in commit
57ee0b2.The first workspace run failed in
failed_agent_stops_detached_descendants. Its helper read an empty release-code file and panicked, producing exit code 101 instead of 17. The process cleanup assertions passed before that status assertion failed. The exact test passed on retry. An isolated run of the unchanged helper reproduced the empty-file panic; this was not a full baseline product rerun. Two tests that first skipped for a missing helper also passed without skips after the helper was supplied.The telemetry failure occurred after its fixture captured an empty HTTP header. Its targeted retry passed without skips. An empty local connection reproduced the same assertion in the unchanged fixture. This demonstrates fixture fragility; the original empty connection remains unexplained. The complete workspace result is not claimed as passed. The examples runner found no scripted examples, so its zero exit code does not establish example or SDK tutorial coverage.
just check, orcargo test --workspace --all-features)cargo fmt --allandcargo clippy --workspace --all-targets --all-features -- -D warningsFormatting and
just clippypassed.CONTRIBUTING.mdrequires the repository's vendored warning allowances, so the strict Clippy command above is not claimed as passed.The initial draft run skipped containment and left a failed
CI Gate. A new run started after review was enabled. Its Linux and macOS deterministic containment checks passed; the full platform tests and final gate remain pending.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.