Skip to content

fix(vmm): bound vcpu/memory arithmetic and reject zero resources at deployment - #1364

Merged
kvinwang merged 4 commits into
nextfrom
fix/vmm-resource-bounds
Sep 24, 2026
Merged

kvinwang merged 4 commits into
nextfrom
fix/vmm-resource-bounds

Conversation

@kvinwang

@kvinwang kvinwang commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

  • round_up (app.rs) and the GiB-to-MiB multiply in configure_hugepage_memory are unchecked. Release builds do not check for overflow, so an absurd vcpu/memory wraps and QEMU starts with a small -smp/-m.
  • validate_resize_request rejects zero vcpu/memory/disk, but deployment (create_manifest_from_vm_config) accepted them, and the VM only failed at launch.

Fix

  • round_up keeps the value when the next multiple would overflow, and the multiply saturates.
  • Deployment rejects the same zero values as resize.

Verification

cargo test -p dstack-vmm, fmt and clippy clean.

Split out of #1282.

@kvinwang
kvinwang merged commit f0750f6 into next Sep 24, 2026
11 checks passed
@kvinwang
kvinwang deleted the fix/vmm-resource-bounds branch September 24, 2026 14:25
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.

1 participant