Repository navigation
fix(enclave): privatize invocation mount beneath shared destination - #9536
Conversation
The v0.28.44 probe (run 37576714531) showed a private state source bound beneath a shared external invocation destination producing one exact shared invocation mount, failing storage-verification/invocation-state. All local allocation roles stayed private. Privatize only the captured invocation mount (non-recursive --make-private) after re-verifying the journal and before the restrictive remount, and fail closed unless invocationAfterRemount is one exact private entry. Host and destination propagation are unchanged. Co-authored-by: Copilot App <[email protected]>
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 17986ea |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The documented failure classification and status are inconsistent with the tests and adjacent documentation.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
This PR addresses shared propagation inherited by enclave invocation-state bind mounts.
Changes:
- Privatizes the captured invocation mount before restrictive remounting.
- Adds unit and privileged Linux regression coverage.
- Documents the probe evidence and mitigation.
| File | Description |
|---|---|
src/cloud-hypervisor/trusted-enclave-storage.ts |
Privatizes and verifies invocation mounts. |
src/cloud-hypervisor/trusted-enclave-storage.test.ts |
Tests privatization outcomes and ordering. |
src/cloud-hypervisor/enclave-mount-capture.integration.test.ts |
Updates shared-destination integration expectations. |
docs/cloud-hypervisor-foundation.md |
Documents evidence and remediation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const mounted = storage.dependencies.mountTmpfs!(plan.invocationHostDir, profiles.script.writableStorageBytes, | ||
| profiles.script.uid, profiles.script.gid, tools); | ||
| if (outcome === 'privatized') await expect(mounted).resolves.toBeUndefined(); | ||
| else if (outcome === 'privatize-denied') await expect(mounted).rejects.toBe(failure); |
| cleanup. A new release and release-pinned environment probe are required to | ||
| establish whether live startup progresses beyond this guard. |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
|
@copilot address review feedback |
Addressed in |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |


Problem
The v0.28.44 environment probe (run 37576714531), using #9532 diagnostics, failed only
storage-verification/invocation-statewithstorage-mount-propagation. Cleanup passed.invocationLocationoutsidesourceBeforeBind/destinationBeforeBindprivate/sharedinvocationBeforeBind[0,5,0,2](no entry)invocationAfterBind,invocationAfterRemount,invocationVerified[1,1,1,0](one exact shared entry)[1,0,1,0](one exact private entry)This supports hypothesis 1. The private
<allocation>/statesource is bound beneath a shared external invocation destination, so Linux shared-subtree semantics make the new mount shared. For this failure, the evidence disproves the other four hypotheses: root re-sharing, local child sharing, duplicate entries, and a missing or misspelled entry.Fix
In
mountTmpfs, after the identity-journaled bind is captured:mount --make-private <invocation-state>on only that captured mount.invocationAfterRemountto be exactly one private entry; otherwise fail withstorage-mount-propagation.The shared destination's covering mount, the host namespace, and all other mounts are unchanged. Existing cleanup still unmounts the captured identity on failure. No mount is selected, deduplicated, or adopted, and no storage cap, mount option, or trust check is relaxed.
invocationAfterBindstill records the inherited shared class for diagnostics.Caveat: as with any bind beneath a shared mount, the kernel may propagate a copy to destination peers at bind time. Those copies are not adopted, and unmounts still propagate through the shared parent.
Tests
storage-mount-propagation. The tests also check command order (--bind→--make-private→ remount), journal verification order, an unchanged host table, sanitized evidence, and cleanup.remount-sharedrow moved to the new test.destination-sharedandshared-bothto pass verification, produce a single-entry sealed snapshot, keep the destination shared, and clean up. It requires privileged Linux and did not run on macOS.src/cloud-hypervisor,src/enclave, and the live-smoke sanitizer (79 suites, 2,147 tests passed).Docs
docs/cloud-hypervisor-foundation.mdhas a new “Private invocation state mount” section with the v0.28.44 evidence and the fix.A new release and a release-pinned environment probe are required to confirm live startup gets past this check.