fix(vmm): bound the event name a guest reports over the host API - #1363
Merged
Merged
Conversation
Raise the default from 64 bytes to 2 KiB and expose it as max_event_name_len in vmm.toml.
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
A guest picks its event names. The body is capped at 4 KiB, but the name is limited only by the 10 MiB prpc body limit. It is logged verbatim and kept in the 20-entry event ring, so a guest can make the host hold about 200 MiB per VM.
Fix
Reject names longer than
max_event_name_len(vmm.toml, default 128 bytes) before logging. The four names the VMM acts on are all under 20 bytes.Verification
cargo test -p dstack-vmm, fmt and clippy clean.Touches
vm_event_reportlike #1271. The two merge cleanly.Split out of #1282.