Skip to content

fix: isolate enclave allocation mount propagation - #9530

Merged
lpcox merged 2 commits into
mainfrom
fix/enclave-private-allocation
Oct 7, 2026
Merged

lpcox merged 2 commits into
mainfrom
fix/enclave-private-allocation

Conversation

@lpcox

@lpcox lpcox commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix the local shared-peer propagation mechanism supported by the v0.28.42 environment-probe run 37566610268: snapshot entries were zero before one wrapper bind, then multiple distinct mount IDs afterward; the allocation root and artifact parent were overlapping shared peers, with outside peers visible.

After creating and durably capturing the role-sized invocation tmpfs, verify its journal identity and run mount --make-private <allocation-root> before creating any child layout or bind. Verify the same identity again and require exactly one private mount-table entry. Subsequent storage verification checks private propagation on the allocation root, invocation state, runs, rootfs preparation, artifact parent, and sealed snapshot.

This breaks the allocation's shared-peer relationship so nested self-binds do not propagate back through overlapping views of the same backing filesystem. It also prevents incoming propagation through that private allocation. The original evidence supports this mechanism but does not prove the complete historical cause or successful end-to-end guest startup.

Scope and safeguards

  • Change only the newly created, identity-journaled invocation tmpfs. Do not change /, /run, the shared storage parent, another invocation, or whole-host namespace propagation.
  • Use non-recursive --make-private on the new empty domain before any children exist.
  • Preserve tmpfs/source/mount identity, role storage ceilings, noexec/nosuid/nodev policy, trusted artifact checks, and sealing.
  • Keep exact-one-match capture and ordinary identity-checked cleanup. Never select a topmost mount, deduplicate rows, adopt unknown identities, retry past a failure, or use lazy unmount.
  • Add required storage-propagation-set and storage-propagation checks in bounded-runtime and bounded-artifacts (179 catalog IDs total), with fixed storage-mount-propagation reason. Command errors, successful no-op commands, shared/slave/shared-slave/unbindable residue, absent/duplicate entries, or later propagation changes fail closed.
  • Keep existing topology diagnostics and the unchanged 16 KiB protected descriptor bound.

Coverage

Deterministic tests cover command ordering and identity verification before mutation, exactly one allocation-scoped propagation command, set/read failures, residual propagation and missing/ambiguous mounts, no child binds after failed verification, readiness blocking in both bounded scopes, and propagation changes on every later checked mount.

The existing opt-in Linux suite now contrasts a minimal unisolated shared-parent baseline with actual fixed production setup beneath private and shared parents. It asserts duplicate distinct IDs in the baseline, private root/artifact-parent and one snapshot mount in fixed production, unchanged parent propagation, and successful ordinary close. All synthetic shared mounts are inside disposable private namespaces. These Linux probes remain opt-in and unverified on this macOS host; no conformance label or live dispatch was applied.

Validation

  • Exact deterministic CI selectors: 43 suites / 1,387 tests passed.
  • Final storage regression assertions: 66 tests passed.
  • Build, type-check, bundle, targeted ESLint (0 errors; warnings), full normal pre-commit source lint/build, changed Markdown lint, registry validation/sync, descriptor bounds and diff checks passed.
  • Nine gated Linux tests compile but are skipped locally. Privileged Linux and release-pinned environment-probe acceptance remain outstanding, not inferred from mocks.

Rollout

After merge, publish a new release containing this commit and run the authorized release-pinned script-only environment probe. v0.28.42 is immutable and does not contain this fix. A probe that progresses beyond mount capture may expose later previously unattempted gates; this PR does not claim guest boot, gateway readiness, or complete live acceptance.

The pre-existing untracked docs/research/ and intentionally unmerged sharp fix remain untouched. No release, merge, or workflow dispatch was performed.

Make the identity-journaled invocation tmpfs private before creating child binds.
Verify private propagation during setup and subsequent storage verification.
Preserve exact mount identity, accounting limits, and ordinary fail-closed cleanup.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 03:32
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-9530 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit a23ce59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The kernel isolation change still requires privileged Linux validation, and the version guidance has an unresolved inconsistency.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Isolates Cloud Hypervisor enclave allocations from shared mount propagation before creating child mounts.

Changes:

  • Makes invocation tmpfs mounts private and verifies propagation.
  • Adds fail-closed checks, readiness gates, and regression coverage.
  • Documents diagnostics and rollout requirements.
File Description
src/​enclave/​startup-progress.test.ts Tests new readiness gates.
src/​cloud-hypervisor/​trusted-enclave-storage.ts Establishes and verifies private propagation.
src/​cloud-hypervisor/​trusted-enclave-storage.test.ts Covers ordering and propagation failures.
src/​cloud-hypervisor/​mount-topology.ts Adds private-mount assertion.
src/​cloud-hypervisor/​mount-topology.test.ts Tests propagation classifications.
src/​cloud-hypervisor/​host-preflight-schema.json Registers checks and failure reason.
src/​cloud-hypervisor/​enclave-mount-capture.integration.test.ts Adds privileged Linux regression scenarios.
docs/​diagnostics/​README.md Documents diagnostic checks.
docs/​cloud-hypervisor-foundation.md Describes isolation design and rollout.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/cloud-hypervisor-foundation.md Resolved
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 92.97% 93.00% 📈 +0.03%
Statements 91.46% 91.48% 📈 +0.02%
Functions 90.14% 90.15% 📈 +0.01%
Branches 85.17% 85.19% 📈 +0.02%
📁 Per-file Coverage Changes (3 files)
File Lines (Before → After) Statements (Before → After)
src/cloud-hypervisor/trusted-enclave-storage.ts 92.2% → 92.5% (+0.28%) 90.1% → 90.4% (+0.32%)
src/nvx/one-shot-adapter.ts 82.9% → 83.5% (+0.60%) 79.8% → 80.3% (+0.56%)
src/log-directory-setup.ts 96.8% → 100.0% (+3.18%) 96.9% → 100.0% (+3.13%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Clarify the requirements for establishing startup progress and the immutability of specific asset versions.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@lpcox
lpcox merged commit 9981121 into main Oct 7, 2026
33 checks passed
@lpcox
lpcox deleted the fix/enclave-private-allocation branch October 7, 2026 03:43
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.

2 participants