Bug 1171717 - SPICE ActiveX plugin crashes when menu is longer than 4096 B
Summary: SPICE ActiveX plugin crashes when menu is longer than 4096 B
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: spice-activex-win
Version: 3.5.0
Hardware: Unspecified
OS: Windows
unspecified
high
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Uri Lublin
QA Contact: SPICE QE bug list
URL:
Whiteboard:
Depends On:
Blocks: 1162792
TreeView+ depends on / blocked
 
Reported: 2014-12-08 13:11 UTC by Frantisek Kobzik
Modified: 2016-03-09 20:04 UTC (History)
12 users (show)

Fixed In Version: spicex-win-3.6-3 rhevm-spice-client-3.6-4
Doc Type: Bug Fix
Doc Text:
Previously, the SPICE ActiveX plug-in sometimes crashed if a dynamic menu string was set larger than 4096 bytes. This happened because the menu string property in the SPICE ActiveX plug-in was stored in a 4096-byte array, and when a new menu string was set, its size was not checked. This was fixed by making the menu string property dynamically allocated according to the size of the new string. Additionally, to limit the memory allocated, the SPICE ActiveX plug-in also checks and rejects all strings that are too large. Strings are now sent to the client as UTF-8, and log messages size is limited. As a result, the plug-in no longer crashes when given a large menu string.
Clone Of:
Environment:
Last Closed: 2016-03-09 20:04:52 UTC
oVirt Team: Spice
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:0377 0 normal SHIPPED_LIVE rhevm-spice-client bug fix and enhancement update 2016-03-10 00:39:05 UTC

Description Frantisek Kobzik 2014-12-08 13:11:07 UTC
Description of problem:
When dynamic menu of SPICE ActiveX plugin is big enough (> 4096), the plugin crashes. The crash is probably caused by limited size of dynamic menu in the client:

SpiceXCommon.h:#define RED_CLIENT_MAX_MENU_SIZE        4096

After adjusting dynamicMenu string so that is smaller than 4k the console connects fine.

NOTE: The bug was repeatedly reproduced on Win8 with IE 10 by various users. I couldn't reproduce the bug on Win7 & IE9.

Version-Release number of selected component (if applicable):
Spice 5.0.3.5002
rhevm-3.5 vt9
IE 10 on Win8 32-bit

Steps to Reproduce:
1. Try to connect to a SPICE VM using browser plugin on Win8 32-bit & IE10.

Actual results:
IE crashes.

Expected results:
IE doesn't crash.

Additional info:
IE doesn't crash if some part (some ISOs) of dynamic menu is dynamically deleted using IE Developer tools.

Comment 1 Uri Lublin 2014-12-15 16:23:34 UTC
I can reproduce the problem, using the html test page + setting the menu size to 16 bytes.

So 4096 bytes is not enough for the menu.
How much is enough ?
How did the menu string get so long ?

One way of fixing this bug is to reject (return an invalid-param error) such long menu strings. That's probably not going to help rhev-m.

Another option is to use a dynamically allocated strings, std::wstring.
This solution trusts RHEV-M to not send much longer strings (MB/GB).

Comment 2 Frantisek Kobzik 2014-12-16 08:44:58 UTC
I could reproduce using file that has around 5.3k. This size is not unrealistic since dynamic menu contains CDs from ISO domain (which can grow to really big sizes).

I think 1 MB is enough for everyone :) (as Michal pointed out, dynamic allocation with no limits/checking could DOS clients).

Comment 8 errata-xmlrpc 2016-03-09 20:04:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-0377.html


Note You need to log in before you can comment on or make changes to this bug.