Repository navigation
Migrate Sandbox OCI owners into delegated cgroup children - #268
Merged
Merged
Conversation
native-linux-service must start below an empty delegated root. CI harnesses live in a sibling probe cgroup; migrate the owner child before exec so advertised Runtime profiles can boot. Use the module-qualified R17 filter.
15 tasks
Advertised profiles under matched setpriv need the same owner elevation wrapper as host-service composition, plus an A3S_HOME chown before the harness runs.
Author
|
Follow-up: R17 now uses matched setpriv + SETPRIV_WRAPPER elevation (same as composition) after the cgroup child migration cleared the previous delegated-root error. |
Effective-root R17 launchers created 0700 parents as UID 0; after bootstrap drop, native-linux-service could not inspect them. Assign the parent to the real UID and keep the launcher as a direct exec so control FDs stay valid.
After device-policy drop the endpoint is owned by the sandbox ruid; euid-0 harnesses must wait on that durable owner identity instead of geteuid.
native-linux-service publishes the socket as the real UID; keep effective root only through spawn, then match SO_PEERCRED without matched-cred elevate wrappers.
Keep saved UID/GID 0 across setresuid so conformance cleanup can remove prepare-time state trees after SO_PEERCRED-matched SDK calls finish.
The helper is only for R17 cleanup inside a3s-box-runtime; do not re-export it.
Lifecycle locks and Runtime state created as effective root must stay writable after the controller matches SO_PEERCRED; keep restore helper test-only.
create_dir_all left the shared sockets directory root:0700, so the real-UID controller could not remove per-execution runtime socket trees on retire.
Device-policy owners drop to ruid before create; UID maps probed with geteuid 0 were rootful and rejected as not mapping container 0 to the durable host ID.
R17 records the certified a3s-oci path but execs a3s-box-sandbox-oci-launcher; treat matching digests as the same owner executable for retire/inspect.
R17 runs many cases in one process; peer-auth drop must not permanently remove CAP_SYS_ADMIN needed for later overlayfs prepares.
Peer-auth drops remove CAP_SYS_ADMIN; unmount merged before deleting box dirs or retire leaves Device or resource busy on R17 long-running services.
Only seteuid/setegid(0) when getresuid retained saved root from the peer-auth drop, then reclaim A3S_HOME to the current effective owner so Runtime state checks pass without breaking ordinary unit tests. Co-authored-by: Cursor <[email protected]>
Control sockets under /tmp/a3s-box-sockets were left root:0600 after bind, so post-drop readiness heartbeats could not connect. Also restore effective root before boot-failure overlay cleanup and retain the underlying boot error. Co-authored-by: Cursor <[email protected]>
Permanent controller euid drops stripped CAP_NET_ADMIN and broke R17 networking relays plus overlay umount. Keep effective root for mounts and TCP endpoints; seteuid to the real owner only around SO_PEERCRED connect. Co-authored-by: Cursor <[email protected]>
Keep the controller at effective root for mounts and networking, but assign each boxes/<id> tree to the real UID so native-linux-service can scan rootfs device nodes after its device-policy drop. Co-authored-by: Cursor <[email protected]>
Clear the euid/ruid mismatch before exec and keep PR_SET_KEEPCAPS across temporary peer-auth seteuid so R17 can load bundled libkrun without stripping CAP_SYS_ADMIN. Co-authored-by: Cursor <[email protected]>
Recovery inspect compared endpoint ownership to geteuid(); with the controller kept at euid 0 the dropped owner socket failed the contract. Co-authored-by: Cursor <[email protected]>
Whole-tree chown walked into R17 read-only bind attachments and failed with EROFS; hand off rootfs (plus the box dir inode) and skip EROFS paths. Co-authored-by: Cursor <[email protected]>
Restore full boxes/<id> chown so merged/root is traversable after device-policy drop, but do not recurse into sandbox/attachments (R17 EROFS bind mounts). Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Skip detached open_tree after device-policy drop so R17 mounts can bind sources owned by the durable mapped identity. Co-authored-by: Cursor <[email protected]>
RO bind remounts after device-policy drop use mount_setattr instead of MS_REMOUNT so the R17 security profile can apply readonly attributes. Co-authored-by: Cursor <[email protected]>
Previous commit only refreshed the lock metadata while CI still packaged 1e0eba9a. Co-authored-by: Cursor <[email protected]>
Keep Sandbox R17 fixes and pin OCI Runtime to 402949c2 (merged open_tree / mount_setattr rootless path) while absorbing mainline KVM qualification and owner-loss reconcile work. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
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.
Summary
09e5874bfailed advertised R17 profiles:rootless executor must run in a host-owned child below its empty cgroup delegation(executor ina3s-box-ci/probe, delegation ina3s-box-ci/delegated).native-linux-serviceafter migrating into a child of the delegated root, matching host-service composition.--exactname forbox_runtime_passes_all_advertised_profilesso the ignored test actually runs.Test plan
prepares_a_child_below_the_delegated_cgroup_rootCloses nothing yet; required evidence for #172 / A3S-Lab/Cloud#85.