Skip to content

Commit d07061a

Browse files
committed
spec: Allow opt-in for faster block CreateVolume
Requiring a newly-created block to read as all zeroes is good security practice, but for some hardware, the time required to explicitly zero out the hardware can be lengthy. Enhance the spec with an option for a CO to request volume creation without regards to contents of the empty volume (safe if the volume will be handed to something that will in turn initialize it, such as mkfs, but risky if handed to something that will try to learn how the data was left by a previous tenant). Existing Plugins that ignore this field (and thereby always zero contents) are still compliant, but adding the field allows for some faster allocations, in a carefully controlled environment where the uninitialized storage is not setting up a data leak. Signed-off-by: Eric Blake <[email protected]>
1 parent de1c3e6 commit d07061a

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

spec.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ Plugins MAY create 3 types of volumes:
789789
- From an existing volume. When plugin supports cloning, and reports the OPTIONAL capabilities `CREATE_DELETE_VOLUME` and `CLONE_VOLUME`.
790790

791791
If CO requests a volume to be created from existing snapshot or volume and the requested size of the volume is larger than the original snapshotted (or cloned volume), the Plugin can either refuse such a call with `OUT_OF_RANGE` error or MUST provide a volume that, when presented to a workload by `NodePublish` call, has both the requested (larger) size and contains data from the snapshot (or original volume).
792-
Explicitly, it's the responsibility of the Plugin to resize the filesystem of the newly created volume at (or before) the `NodePublish` call, if the volume has `VolumeCapability` access type `MountVolume` and the filesystem resize is required in order to provision the requested capacity. Likewise, if an empty volume is created, the Plugin must ensure that an access type `BlockVolume` exposes all bytes to initially read as zero, while an access type `MountVolume` exposes a filesystem with no files pre-populated.
792+
Explicitly, it's the responsibility of the Plugin to resize the filesystem of the newly created volume at (or before) the `NodePublish` call, if the volume has `VolumeCapability` access type `MountVolume` and the filesystem resize is required in order to provision the requested capacity. Likewise, if an empty volume is created, the Plugin must ensure that an access type `BlockVolume` exposes all bytes to initially read as zero (unless the wipe_mode was `UNINITIALIZED`), while an access type `MountVolume` exposes a filesystem with no files pre-populated.
793793

794794
```protobuf
795795
message CreateVolumeRequest {
@@ -922,7 +922,23 @@ message CreateVolumeResponse {
922922
message VolumeCapability {
923923
// Indicate that the volume will be accessed via the block device API.
924924
message BlockVolume {
925-
// Intentionally empty, for now.
925+
enum WipeMode {
926+
// The Plugin MUST ensure that all bytes of the volume initially
927+
// read as zero.
928+
ALL_ZEROES = 0;
929+
930+
// Bytes in the volume may initially have unspecified contents; a CO
931+
// that uses this mode for potentially faster creation times MUST
932+
// ensure that the end use of the storage will not be confused by
933+
// reading unitialized data (do not use this option in a scenario
934+
// where reading prior contents can constitue a security leak).
935+
UNINITIALIZED = 1;
936+
}
937+
938+
// This field is OPTIONAL; providing it with a non-zero value in order
939+
// to potentially speed up volume creation should only be attempted when
940+
// the security risks have been analyzed.
941+
WipeMode wipe_mode = 1;
926942
}
927943
928944
// Indicate that the volume will be accessed via the filesystem API.

0 commit comments

Comments
 (0)