fix(vmm): enforce port mapping policy on update_vm - #1286
Merged
Merged
Conversation
kvinwang
force-pushed
the
fix/operator-boundary
branch
from
September 24, 2026 04:52
46cd04a to
4dca9f7
Compare
kvinwang
force-pushed
the
fix/operator-boundary
branch
from
September 24, 2026 05:41
4dca9f7 to
b904504
Compare
kvinwang
added this pull request to stack #1352
September 24, 2026 06:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
create_manifest_from_vm_configenforcescvm.port_mapping(enabledandrange), butupdate_vmbuilds its port map without consulting it.CreateVmwith no ports followed byUpdateVm { update_ports: true, ports: [...] }publishes any host port, even on a node with port mapping disabled (GHSA-hqm3-qmh8-5xx2).The update path also parses an empty
host_addressinstead of falling back tocvm.port_mapping.address, so a request shape valid at deploy time fails on update with "Invalid host address".Fix
Both paths go through a shared
port_map_from_proto. Mappings the VM already holds are exempt from the policy check: the web UI sendsupdate_ports = truewith the full current list on every update, so without the exemption narrowing the node's policy would block every other update to an affected VM. Deployment passes no held mappings.Compat: updates that add a mapping outside the node's policy are now rejected; an omitted
host_addresson update is now accepted.GPU part split into #1346 (merged).
Verification
cargo test -p dstack-vmm(211 passed),cargo clippy -p dstack-vmm --bins -- -D warnings,cargo fmt --check.