Skip to content

[DRAFT RDTE] Fence layered state-init against an active WineBot writer - #201

Closed
mark-e-deyoung wants to merge 3 commits into
rdte/mvp-early-entrypoint-writer-admission-20261122from
rdte/layered-state-init-writer-fence-r1-20261123
Closed

mark-e-deyoung wants to merge 3 commits into
rdte/mvp-early-entrypoint-writer-admission-20261122from
rdte/layered-state-init-writer-fence-r1-20261123

Conversation

@mark-e-deyoung

Copy link
Copy Markdown
Collaborator

R040 independent state-init writer-fence qualification (single-host/cooperative only)

Source: immutable parent #184 b76846de498f28f3a26ef4bfcf23d7fef3078746. This draft adds a fail-closed nonblocking kernel flock in the app-bundle's one-shot state initializer on the same externally mounted /state/artifacts/sessions/.winebot-active-writer.lock inode that WineBot's runtime Python writer-admission uses as /artifacts/sessions/.winebot-active-writer.lock. It verifies direct non-symlink lock ancestry, single link, FD/dev/inode identity, exact root/uid1000 0600 lock schema and requires exclusive admission before any ownership changes to persistent user volumes. It never deletes user state. State-init exits with a fixed diagnostic when runtime is already writing.

The isolated state-init only gains CHOWN+D​​AC_OVERRIDE to reopen the uid1000-owned 0600 lock after the first boot; no network, other capabilities, third-party install, rootfile write, service token, production host or image publication. App-bundle build requires flock present, otherwise fails closed (do not auto-install dependencies). Added offline independent-open-file-description contender test and source/ordering controls, plus an actual second one-shot state-init in the already-existing public Wine11 layered composite HIL while its first runtime is healthy. Any success by the second initializer fails HIL. No private GHA minutes; exact-head current CI must be read before acceptance.

Critical limits: A short-lived state-init relinquishes its OFD on exit and runtime subsequently acquires the same lock. Thus simultaneous cooperative mutation is prevented once the lock is proven, but there remains a non-atomic deployment ownership/handoff interval: competing Compose projects can win the lock after one state-init completes and before its runtime starts. No generation/lease attestation, unrelated hostile same-UID containment, cross-host/NFS consensus or end-to-end deployment admission is claimed. An external controller-held lease or complete post-admission in-process state initialization must close the handoff gap before release. The unrelated pre-runtime app-seed is separate and versioned. Added CAP_DAC_OVERRIDE is an explicit privilege tradeoff requiring security review.

Draft only / do not merge / not ready for hardware. Requires exact-head public synthetic tests, long Wine11 composite HIL and adversarial competing-deployment review. Main and owners #184/#187/#200 unchanged; DLE remains the authority.

Copy link
Copy Markdown
Collaborator Author

R040 first-red / corrective head / precise nonclaims — 2026-11-23

Current draft rdte/layered-state-init-writer-fence-r1-20261123@2159807b731ba757e2104be8cf1308665d3d426c. First new disposable layer run #45171637561 terminal FAIL at LAYER_RDTE stage=state_preparation_idempotency, not at first initialization: the independent disposable harness (scripts/ci/qualify-disposable-layers.sh) still launched root with legacy CAP_CHOWN-only, unlike candidate Compose's CHOWN+DAC_OVERRIDE requirement for reopening an existing UID1000-owned mode-0600 lock. Changed only that harness to match both first/second state-init invocations and documented privilege need in commit 2159807, preserving fail-closed lock and all replay expectations. New exact-head disposable run #45171800157, CI #45171800284 and live Wine11 HIL #45171800176 PENDING/IN PROGRESS at readback. No green assumed.
Security gate: CAP_DAC_OVERRIDE raises privilege within the isolated root initializer, requires independent threat review. POSIX flock prevents overlapping cooperative mutations after admission but does not atomically transfer deployment ownership or protect across hosts / hostile same-UID aliases. Keep DRAFT / BLOCKED for release.

Copy link
Copy Markdown
Collaborator Author

R040 source-exact correction verified — 2026-11-23

At exact 2159807b731ba757e2104be8cf1308665d3d426c, public disposable layer contract/replay run #45171800157 is now terminal SUCCESS. The first red stage state_preparation_idempotency on older source required matching the already-approved isolated state-init container DAC_OVERRIDE capability in the independent disposable test harness; no lock bypass or state validation waiver. Formal and provenance checks have separate green receipts. Source exact Wine11 HIL #45171800176 and broad CI #45171800284 still running at latest read. Draft remains release-blocked by non-atomic state-init→runtime OFD transfer and privilege review. No new code changes to this head after qualification.

Copy link
Copy Markdown
Collaborator Author

R040 housekeeping — exact-source superseded, not released

This independent source draft is wholly carried forward by integration PR #205, exact b520f5c419d1199ff536d5c6f8260dcadd2bc5ed. The exact source is the second parent of #205; full CI and source-built Wine11 composite HIL passed. The guest-writable runtime writer lock security STOP remains.

Decision: close this redundant review surface as superseded without merge. No code from this PR is thereby accepted on protected main; all relevant release/security/provenance gates remain. Do not delete this source branch: a local-worktree census is still unavailable, and the immutable commit is referenced by the integration ancestry. Follow #205 and the authoritative winebot-research DLE #3 for new work. A hidden independent requirement can justify reopening with source evidence.

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.

1 participant