glove/tests/control
0xkite 161b30616d
fix(control): stop runtime-root subdirectory staging from failing local-service identity
The local-service proxy factory's operational identity rechecked the
runtime root with the exact dev/ino/uid/mode/nlink tuple, but a
directory's st_nlink is 2 plus its subdirectory count on ext4, tmpfs,
and APFS. Every prepare_session mkdirat(2)s a svc-* staging directory
under that root (and inode-safe teardown removes it), so the root's
link count necessarily changes and the factory itself - or any second
factory sharing the same runtime root - failed the next operational
check as false "identity drift". Proven on Ghost at base 4900bda4:
baseline LastTest.log line 666, root nlink 2 -> 3 verified by
instrumentation; the whole downstream local-service test flow was
blocked. The term could never distinguish sanctioned staging from
tampering: only subdirectory creation moves a directory's nlink, files
and symlinks do not, and writes to this owner-only root are trusted
operator authority per session-policy. The production runtime root is
also shared with the gloved instance lock and control socket, so entry
enumeration whitelisting would add no real enforcement claim.

Drop only the root nlink term from operational(): the root's
dev/ino/uid/mode stay exact (replacement and permission drift still
fail closed, covered by the existing chmod test), and the
descriptor-pinned endpoint parents and sockets retain the exact
dev/ino/uid/mode/nlink recheck in endpoint_current(), which is where
the recorded endpoint identity drift claim (architecture.md) lives.
Unknown drift remains fail-closed.

Add a deterministic regression: two factories sharing one runtime root,
and one factory preparing consecutive sessions, must stay operational
across a prepare_session, while chmod on the root still fails closed.
The test fails on pre-fix code (Ghost: operational() false at the first
post-prepare check).

While validating on Ghost (kernel 6.12), the test's downstream
guest-socket ABA section needed two determinism repairs of its own,
both previously unreachable there because the baseline always failed
earlier: resolve the session directory by its exact staged svc-* name
instead of readlink of the detached open_tree mount (6.12+ renders
detached mount roots as "/" in /proc/self/fd), and stage the ABA
replacement listener at a fresh path before swapping it in so the
replacement cannot recycle the just-freed socket inode (the documented
same-UID ABA caveat) and accidentally satisfy the identity check.
2026-08-31 17:46:28 -06:00
..
apple_container_session_runtime_test.cpp feat(control): neutral guest channels, quarantine recovery, capability sealing, local-service proxy 2026-08-30 20:28:41 -06:00
apple_container_unavailable_test.cpp Merge current PR #23 head 4097a21 with validated Apple repairs 2026-08-29 09:41:16 -06:00
gloved_lifecycle_test.cpp feat(control): neutral guest channels, quarantine recovery, capability sealing, local-service proxy 2026-08-30 20:28:41 -06:00
guest_channel_test.cpp feat(control): neutral guest channels, quarantine recovery, capability sealing, local-service proxy 2026-08-30 20:28:41 -06:00
guest_channel_transport_test.cpp feat(control): neutral guest channels, quarantine recovery, capability sealing, local-service proxy 2026-08-30 20:28:41 -06:00
linux_process_identity_test.cpp Initial Glove sandbox baseline 2026-07-19 21:06:11 -04:00
linux_session_executor_test.cpp fix(control): report start replay disposition, hard-cap jsonl audit journal, deterministic control tests 2026-08-31 09:34:45 -06:00
linux_session_preparation_test.cpp feat(adoption): harden Pi harness sessions 2026-08-02 18:10:55 -04:00
local_service_proxy_test.cpp fix(control): stop runtime-root subdirectory staging from failing local-service identity 2026-08-31 17:46:28 -06:00
observation_intent_unix_server_test.cpp feat(control): neutral guest channels, quarantine recovery, capability sealing, local-service proxy 2026-08-30 20:28:41 -06:00
receipt_audit_protocol_test.cpp fix(control): report start replay disposition, hard-cap jsonl audit journal, deterministic control tests 2026-08-31 09:34:45 -06:00
receipt_audit_server_fixture.cpp fix(control): survive broken control-pipe writes and g++ -Wchanges-meaning 2026-08-31 07:33:59 -06:00
receipt_audit_unix_server_test.cpp fix(control): report start replay disposition, hard-cap jsonl audit journal, deterministic control tests 2026-08-31 09:34:45 -06:00
remote_exec_test.cpp feat(remote): add construction-only backend 2026-08-07 22:27:35 -04:00
remote_protocol_test.cpp fix(ci): require complete designated initializers 2026-08-14 15:27:14 -06:00
remote_session_runtime_test.cpp feat(remote): add construction-only backend 2026-08-07 22:27:35 -04:00
remote_validation_executor_test.cpp fix(ci): require complete designated initializers 2026-08-14 15:27:14 -06:00
remote_validation_test.cpp fix(ci): require complete designated initializers 2026-08-14 15:27:14 -06:00
sage_guest_channel_adapter_test.cpp feat(control): neutral guest channels, quarantine recovery, capability sealing, local-service proxy 2026-08-30 20:28:41 -06:00
session_registry_test.cpp feat(control): neutral guest channels, quarantine recovery, capability sealing, local-service proxy 2026-08-30 20:28:41 -06:00