Skip to content

fix(windows): WHPX bridge/pool/update fail-closed (#259-#263) - #264

Merged
ZhiXiao-Lin merged 32 commits into
mainfrom
fix/windows-whpx-259-263
Sep 8, 2026
Merged

ZhiXiao-Lin merged 32 commits into
mainfrom
fix/windows-whpx-259-263

Conversation

@ZhiXiao-Lin

@ZhiXiao-Lin ZhiXiao-Lin commented Sep 7, 2026 •

Copy link
Copy Markdown

Summary

Closes the next-wave Windows WHPX fail-closed gaps found after PR #258.

Closes #259
Closes #260
Closes #261
Closes #262
Closes #263

Test plan

  • cargo test -p a3s-box-cli --lib windows bridge/smp/update unit tests
  • cargo test -p a3s-box-runtime --lib validate_update_values_rejects_windows
  • cargo test -p a3s-box-cli --test command_coverage windows_sandbox_and_tee
  • cargo test -p a3s-box-cli --test command_coverage stopped_managed_update

ZhiXiao-Lin and others added 3 commits September 7, 2026 21:07
Reject bridge networking before pull and refuse network create on Windows,
exit immediately from pool start, and apply WHPX single-vCPU validation to
container-update so invalid counts are never persisted.

Closes #259
Closes #261
Closes #262
Closes #263
Closes #260

Co-authored-by: Cursor <[email protected]>
Observe exit_code/has_exited before try_wait_exit and skip a redundant wait once the provider is already terminal. Also initialize BoxConfig in struct form for clippy.

Co-authored-by: Cursor <[email protected]>
@ZhiXiao-Lin

Copy link
Copy Markdown
Author

Pushed CI fixes for main-breaking Test/Clippy failures brought in by the recent warm-pool/destroy changes: avoid double try_wait_exit during Unix destroy, and fix field_reassign_with_default in the clear-template test.

ZhiXiao-Lin and others added 26 commits September 8, 2026 11:24
SDK Local Sandbox failed because a3s-box-sandbox-oci-launcher was
never shipped beside a3s-oci. Install the same binary under the
launcher name and wire CI/release/install checks to require it.

Co-authored-by: Cursor <[email protected]>
Sandbox owners always pass --delegated-cgroup-root; pin past the
rootless merge (and #231) so packaged a3s-oci accepts the flag.

Co-authored-by: Cursor <[email protected]>
Unquoted expansion made printf concatenate +cpu+cpuset+... which kernel rejects as Invalid argument.

Co-authored-by: Cursor <[email protected]>
AT_SECURE ignores LD_LIBRARY_PATH, so rustc cannot load librustc_driver under the Sandbox identity. Build with the runner user, then run the harness via setpriv.

Co-authored-by: Cursor <[email protected]>
UTF-8 BOM made bash treat the shebang as a command. On composition failure, also tail owner.stdout/stderr under A3S_HOME and OCI host root.

Co-authored-by: Cursor <[email protected]>
Include owner stderr/stdout tails in startup Unavailable errors, and recreate A3S_BOX_OCI_HOST_ROOT under the Sandbox identity before the SDK composition harness runs.

Co-authored-by: Cursor <[email protected]>
Avoid poisoned sockets/owner records from earlier steps by installing a fresh A3S_BOX_OCI_HOST_ROOT owned by the Sandbox CI identity.

Co-authored-by: Cursor <[email protected]>
Host-service rootless open rejects the sibling probe cgroup; migrate the
composition harness into delegated/ci-harness so the owner is a host-owned
child below the empty delegation root.

Co-authored-by: Cursor <[email protected]>
Capability probes use access(W_OK) against the real UID under setpriv; the
delegated/ci-harness child must own subtree_control like probe/delegated.

Co-authored-by: Cursor <[email protected]>
Keep the CI harness in the sibling probe cgroup for capability checks, and
move only the forked native-linux-host-service into a fresh delegated child
before setuid drop so rootless open accepts host-owned membership.

Co-authored-by: Cursor <[email protected]>
Rootless probes use access(W_OK) against the real UID; own subtree_control
on the delegated owner child before the pre_exec credential drop.

Co-authored-by: Cursor <[email protected]>
… cpuset

Composition failed with Broken pipe because the rootless owner authenticates
SO_PEERCRED euid while the harness stayed euid 0. Run composition with matched
creds and chown the CI cgroup root procs for owner migration. Also reject
inverted --cpuset-cpus ranges at CLI admission (#267).

Co-authored-by: Cursor <[email protected]>
append_path_with_name opens special files and can hang or emit empty
tar paths on FIFOs. Encode them as zero-length Fifo entries and include
them in diff baselines so a3s-box diff lists FIFO changes.

Co-authored-by: Cursor <[email protected]>
Deterministic scale operation IDs no longer dead-end on Failed create
outcomes; MicroVM startup-terminal paths drop the in-process owner so
retries can converge. Facade scale tests use MicroVM isolation on Windows.

Co-authored-by: Cursor <[email protected]>
Earlier Sandbox steps create root-owned home content under euid 0
setpriv; composition runs euid==ruid and needs write access for state.

Co-authored-by: Cursor <[email protected]>
Matched-creds composition runs without CAP_NET_ADMIN; creating a host
bridge for prune coverage fails with Permission denied before the OCI
owner exercise. Keep bridge prune on MicroVM smoke only.

Co-authored-by: Cursor <[email protected]>
Matched-cred composition keeps the harness at euid==ruid for Unix peer
auth, while the owner child uses the CI setpriv wrapper (and OCI Runtime
9ff67c54) so native-linux-host-service can install the rootless device
helper before dropping to the real UID.

Co-authored-by: Cursor <[email protected]>
ZhiXiao-Lin and others added 3 commits September 8, 2026 22:42
Expect Sandbox UID ownership for host-service evidence after device-policy
drop, and run the installed-product smoke with the same matched harness plus
owner setpriv elevation used by composition.

Co-authored-by: Cursor <[email protected]>
Elevated CI launches go through sudo/setpriv, so Child::id is a supervisor.
Rewrite box-owner.json from the ready socket peer so recovery looks under the
real a3s-oci executor root.

Co-authored-by: Cursor <[email protected]>
Format oci_owner SO_PEERCRED helpers and bump the OCI Runtime pin to the
merged host-service device-policy revision on main.

Co-authored-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment