Bug 1375677 - Crash when performing VNC websockets handshake
Summary: Crash when performing VNC websockets handshake
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Guo, Zhiyi
Depends On:
TreeView+ depends on / blocked
Reported: 2016-09-13 16:33 UTC by Daniel Berrangé
Modified: 2016-11-07 21:36 UTC (History)
7 users (show)

Fixed In Version: qemu-kvm-rhev-2.6.0-26.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2016-11-07 21:36:01 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2673 0 normal SHIPPED_LIVE qemu-kvm-rhev bug fix and enhancement update 2016-11-08 01:06:13 UTC

Description Daniel Berrangé 2016-09-13 16:33:01 UTC
Description of problem:
When using VNC with TLS and websockets, QEMU will crash when the client connects


This is a regression vs 2.4.0 and fixed in

commit bc35d51077b33e68a0ab10a057f352747214223f
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Tue Jun 7 12:27:51 2016 +0100

    io: remove mistaken call to object_ref on QTask
    The QTask struct is just a standalone struct, not a QOM Object,
    so calling object_ref() on it is not appropriate. This results
    in mangling the 'destroy' field in the QTask struct, causing
    the later call to qtask_free() to try to call the function
    at address 0x1, with predictably segfault happy results.
    There is in fact no need for ref counting with QTask, as the
    call to qtask_abort() or qtask_complete() will automatically
    free associated memory.
    This fixes the crash shown in
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Run QEMU with websockets + TLS eg

  $ qemu-system-x86_64 -vnc,tls,x509=/etc/pki/qemu,websocket=5701

2. Connect with the noVNC client with TLS enabled

Actual results:
QEMU crashes

Expected results:
Connection completes

Additional info:

Comment 3 Miroslav Rezanina 2016-09-20 12:30:53 UTC
Fix included in qemu-kvm-rhev-2.6.0-26.el7

Comment 5 Daniel Berrangé 2016-09-21 10:48:45 UTC
NB you can actually trigger the crash without TLS too. eg with just

  $QEMU -vnc,websocket=5902,password

If you are trying to trigger the crash with TLS, then you need to make sure to import the CA certificate used by QEMU into the web browser CA store, otherwise firefox will drop the connection before triggering the crash due to invalid CA.

Comment 6 Guo, Zhiyi 2016-09-21 13:48:15 UTC
Reproduce this issue against qemu-kvm-rhev-2.6.0-25.el7.x86_64.

1. boot qemu by: /usr/libexec/qemu-kvm -vnc :1,websocket=5701
2. Download noVNC and lauch websocket server by: ./utils/launch.sh, follow the onVNC prompt, browse http://dhcp-9-154.nay.redhat.com:6080/vnc.html?host=dhcp-9-154.nay.redhat.com&port=5701 from firefox or chrome

After step 2, qemu crash with backtrace:
#0  0x0000000000000001 in ?? ()
#1  0x00007f96fdc731d3 in qio_task_free (task=0x7f97021675a0) at io/task.c:58
#2  0x00007f96fdc732da in qio_task_complete (task=<optimized out>)
    at io/task.c:145
#3  0x00007f96fdc72fb1 in qio_channel_websock_handshake_send (
    ioc=0x7f9701bdbce0, condition=<optimized out>, user_data=0x7f97021675a0)
    at io/channel-websock.c:289
#4  0x00007f96f4a08d7a in g_main_context_dispatch ()
   from /lib64/libglib-2.0.so.0
#5  0x00007f96fdc119e0 in glib_pollfds_poll () at main-loop.c:213
#6  os_host_main_loop_wait (timeout=<optimized out>) at main-loop.c:258
#7  main_loop_wait (nonblocking=<optimized out>) at main-loop.c:506
#8  0x00007f96fd9df70f in main_loop () at vl.c:1936
#9  main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
    at vl.c:4692

Verify against qemu-kvm-rhev-2.6.0-26.el7.x86_64, after step 2, no qemu crash happen, and noVNC connect to websocket of qemu

Comment 9 errata-xmlrpc 2016-11-07 21:36:01 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.


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