diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d80200b6..5bbc05aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- guest: a fresh CVM with a verity volume could take the volume for its data disk and try to LUKS-format it: volumes labelled their data partition `dstack-data`, the data disk's label. `dstack verity` now labels it `dstack-volume-data`, and the guest skips disks that carry a `dstack-volume` partition, so volumes built by older releases are safe too + ### Changed - vmm: `qmp_socket` now defaults to `true`. Each CVM's QEMU exposes `qmp.sock` in its work dir, so the host can change disk options or compact a bloated `hda.img` (`blockdev-mirror`) without stopping the CVM. Applies to CVMs started after the change; set `qmp_socket = false` to opt out diff --git a/docs/verity-volumes.md b/docs/verity-volumes.md index 6c7dac295..431f01400 100644 --- a/docs/verity-volumes.md +++ b/docs/verity-volumes.md @@ -9,11 +9,16 @@ hash measured in `app-compose.json`. A built volume is a raw GPT image: ```text -p1: DSTACK_VOLUME metadata envelope -p2: filesystem data -p3: dm-verity superblock and hash tree +p1 dstack-volume: DSTACK_VOLUME metadata envelope +p2 dstack-volume-data: filesystem data +p3 dstack-verity: dm-verity superblock and hash tree ``` +The guest opens the partitions by number; the labels only keep a volume apart +from the app data disk, whose partition is `dstack-data`. Older volumes label +p2 `dstack-data` too; the guest skips any disk with a `dstack-volume` +partition when it looks for the data disk. + The envelope identifies a candidate disk. It is not trusted. The guest passes the root from the measured app compose to `veritysetup`, so a forged envelope or partition table cannot substitute different contents. diff --git a/dstack/crates/dstack-volume/src/volume.rs b/dstack/crates/dstack-volume/src/volume.rs index 604e86ac1..ba9ee6ac1 100644 --- a/dstack/crates/dstack-volume/src/volume.rs +++ b/dstack/crates/dstack-volume/src/volume.rs @@ -332,7 +332,7 @@ fn write_gpt(mut out: fs::File, layout: &GptLayout, root_hash: &str) -> Result