Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too long description of the VM will cause an error #1889

Open
yunmingyang opened this issue Nov 1, 2024 · 1 comment · May be fixed by #1891
Open

Too long description of the VM will cause an error #1889

yunmingyang opened this issue Nov 1, 2024 · 1 comment · May be fixed by #1891

Comments

@yunmingyang
Copy link
Contributor

Description of problem:
When setting a description for a VM, if setting a too long string, such as 3964928 * 's', there will be an error shown on the dialog, maybe we need to limit the length of the description

Version-Release number of selected components (if applicable):
cockpit-machines-322-11-g63ac3f46

@mvollmer
Copy link
Member

mvollmer commented Nov 1, 2024

Yes, I can reproduce this. Cockpit has a limit of 128KiB for a protocol message, and setting the description works by passing it inside a "channel open" control message to the bridge. If the description makes that message exceed 128KiB, cockpit-ws will forcefully disconnect the session.

As you say, it's probably to just limit the size of the description before sending such a large message. I didn't find a quick way to make virt-xml read the description from stdin, for example.

mvollmer added a commit to mvollmer/cockpit-machines that referenced this issue Nov 1, 2024
Descriptions longer than about 128KiB will crash the Cockpit session
with a protocol error since they are included in the open message for
a "spawn" channel.

Only use the first 32k (about) when setting them to avoid that.

Fixes cockpit-project#1889
@mvollmer mvollmer linked a pull request Nov 1, 2024 that will close this issue
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 a pull request may close this issue.

2 participants