You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 03b7ccb
Browse filesBrowse the repository at this point in the historyBrowse files
host: keep the export's pins in the CLI and paths only in ExportPlan
ExportPlan, the public description of a VM's export, combined the host
paths with the file identities that only the CLI's store needs: each
child's denied_identities, each bind's identity, and FileIdentity, with
check's rules that a recorded plan pins each object that a workload
could move. The paths are what nvx lowers; the identities are the CLI's
recheck of its own records before each start.
The CLI now owns PlannedExport { description: ExportPlan, pins: Pins },
crate-private and cli-gated beside the planner and the verifier that
SL6.5a2 made private:
- The planner returns a PlannedExport: the description, and the pins
of each child's denied paths and of each bind, in their orders,
which it computes as before. The binds keep their pins as they are
sorted.
- PlannedExport::check runs ExportPlan::check, then the pin rules that
moved out of it: a slot for each child and each of its denied paths,
one for each bind, and the identity of each denied or mapped object
strictly inside a part that the guest may write, with the same
messages. PlannedExport::verify is the old ExportPlan::verify, which
reads the identities from the pins.
- The sandbox's config.json keeps the description under export, paths
only, where CI's share checks read it, and records the pins beside it
under export_pins, as it records each image beside its binding.
Config::new requires the field and refuses an export without pins or
pins without an export as malformed; Config::check checks and
verifies the pair before vm_config passes the description to the VM.
plan_mounts, provision's ProvisionConfig and check_images carry the
PlannedExport; nvx-rs run, which launches its plan at once and never
again, keeps the description and checks no pins, as before.
nvx's public API loses FileIdentity, ExportChild::denied_identities,
Bind::identity, and ExportPlan::openvmm_arguments and kernel_token,
which only VmConfig's lowering calls and which become pub(crate);
lowering is unchanged. ExportPlan::check stays structural and needs no
identity data. host::filesystem documents what the caller keeps stable:
the launch race, the writable-part recheck and durable denials.
A configuration that an earlier build wrote has no export_pins, so a
start refuses it as "sandbox configuration has no export pins;
deprovision the sandbox and provision it again", as for every field
that the record gained before; nothing is migrated, and the format
stays 10.
Tests: the planner's and verifier's unit tests read the pins from the
PlannedExport, and narrowed_writes_pin_only_what_lies_in_writable_paths
also checks the new slot rules; ExportPlan's own tests and fixtures,
in host::config, host::vm, the restore tests and tests/cli/openvmm.rs,
build plans without identities. A new state test records an export
with its pins, reads both back, and refuses a moved, a gone and an
uninspectable pinned object at Config::check. The CLI's lifecycle
tests expect export_pins in each record, and malformed_configuration
refuses a record without it, an export without pins, and pins without
an export.
Part of #1125 (SL6.5b).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: doc/acceptance-case-matrix.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -242,7 +242,7 @@ The adapter's README said what each proved.
242
242
|`a_run_whose_clone_does_not_start_runs_nothing`| retired | Template selections and the template's `run` leave with the old clone path (#1121) |
243
243
|`a_run_whose_clone_s_vm_exits_during_its_execution_ends_with_the_clone_s_failure`| retired | The template's `run`, clone records and leases leave with the old clone path (#1121) |
244
244
|`a_selection_that_names_no_template_leases_nothing`| retired | Template selections and leases leave with the old clone path (#1121) |
|`a_start_refuses_an_export_whose_mapped_objects_changed_before_any_vmm_starts`| rewritten |`nvx-rs/src/host/filesystem/tests.rs::an_exported_object_that_a_workload_could_move_is_checked_again_before_a_start`; `nvx-rs/src/host/filesystem/tests.rs::swapped_objects_fail_verification`; `nvx-rs/src/host/cli/sandbox/state/tests.rs::records_keep_the_export_with_its_pins_and_starts_refuse_changed_pins`, whose record keeps the pins beside the export, and whose start refuses a changed pin before the VM's configuration takes the export (SL6.5b)|
|`a_tombstone_leaves_the_running_clone_of_its_generation_to_its_lease`| retired | Tombstones, generations and leases leave with the old clone path (#1121) |
Copy file name to clipboardExpand all lines: nvx-rs/README.md
+18-8Lines changed: 18 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -937,16 +937,26 @@ action that needs more than 256 rules.
937
937
938
938
The `ExportPlan` of host paths through OpenVMM's aggregate virtio-fs device, for
939
939
a root's `ReservedTargets`, the blockless root's or the container root's: its
940
-
children, its ordered binds, which give the host-mapping table, and the
941
-
identities that each start checks again; `ExportPlan::check`, which checks a
942
-
recorded plan without reading the host, and the plan's OpenVMM options, boot
943
-
token, and mapping table; and `guest_path` (also at `nvx::`), the guest path at
944
-
which the host-path convention places a resolved host path.
940
+
children and its ordered binds, which give the host-mapping table, paths only;
941
+
`ExportPlan::check`, which checks a recorded plan without reading the host, and
942
+
the plan's mapping table, `ExportPlan::guest_table`; and `guest_path` (also at
943
+
`nvx::`), the guest path at which the host-path convention places a resolved
944
+
host path. A `VmConfig` lowers the plan into OpenVMM's options and its
945
+
`nvx_maps` boot token internally.
946
+
947
+
OpenVMM resolves the plan's paths only when it starts, so the caller keeps them
948
+
naming the objects that it means, as the module documents: across the launch
949
+
race, from its own checks of the host until OpenVMM opens the paths; through a
950
+
writable-part recheck before each later launch, since a workload that may write
951
+
a part of a child can move a mapped or denied object there and put a decoy at
952
+
its path; and for each durable denial, which holds only while its path names
953
+
the object that it hides.
945
954
946
955
The planner, which turns the mapped host paths at their guest targets, their
947
-
denied, allowed, and write paths, and the owner into a plan, and the checks of a
956
+
denied, allowed, and write paths, and the owner into a plan, with the pins of
957
+
the objects that a workload could move, and the checks of those pins and of the
948
958
plan's host objects before each start are the CLI's path rules, private to the
949
-
crate (feature `cli`).
959
+
crate (feature `cli`). The CLI records the pins beside the plan.
950
960
951
961
### `nvx::host::nvxs`
952
962
@@ -1930,7 +1940,7 @@ provision it again:
1930
1940
1931
1941
| File | Contents |
1932
1942
| --- | --- |
1933
-
| `config.json` | The provisioned sandbox, in format 10 only: `image` holds its format, path and identity; `upper` is tagged as scratch with its path or RAM with `max_memory_percent`. `distro_binding` binds the image, and `scratch_binding` binds scratch or is `null` for RAM. The export is typed, `null` when absent. `network`, `null` without `--net`, holds `--net`, `--network-egress`, `--network-ingress`, `--host-loopback`, `--network-proxy`, each `null` when not given, and the `--host-loopback-forward` options, as given, with the egress rules in OpenVMM's form, from a policy file's compile if one was given. A sandbox that `snapshot restore` provisioned also records its snapshot's name under `source_snapshot`, the absolute path of the snapshot's store under `source_store`, and the program and arguments of the workload that each restore runs under `workload`; one that boots cold records none of them. An atomic pretty-JSON write uses mode 0600, and start reads the same strict typed fields without a legacy reader. |
1943
+
| `config.json` | The provisioned sandbox, in format 10 only: `image` holds its format, path and identity; `upper` is tagged as scratch with its path or RAM with `max_memory_percent`. `distro_binding` binds the image, and `scratch_binding` binds scratch or is `null` for RAM. The export is typed, `null` when absent, and holds paths only; `export_pins`, `null` without an export, holds the identities of the export's denied and mapped objects that a workload could move, which each start checks before it launches the export, and a configuration without it is refused with the advice to deprovision the sandbox and provision it again. `network`, `null` without `--net`, holds `--net`, `--network-egress`, `--network-ingress`, `--host-loopback`, `--network-proxy`, each `null` when not given, and the `--host-loopback-forward` options, as given, with the egress rules in OpenVMM's form, from a policy file's compile if one was given. A sandbox that `snapshot restore` provisioned also records its snapshot's name under `source_snapshot`, the absolute path of the snapshot's store under `source_store`, and the program and arguments of the workload that each restore runs under `workload`; one that boots cold records none of them. An atomic pretty-JSON write uses mode 0600, and start reads the same strict typed fields without a legacy reader. |
1934
1944
|`sandbox.lock`| The store's lock, which serializes the lifecycle transitions |
1935
1945
|`exec.lock`| The exec lock, which an `exec` holds from before it finds the running VM until its workload ends, so that one `exec` at a time runs in the sandbox; it stays from the first `exec` until `deprovision`|
1936
1946
|`launch.json`| The store's journal of a start in progress, or of one that was interrupted |
0 commit comments