Hide Forgot
Description of problem: The channel event SPICE_CHANNEL_EVENT_DISCONNECTED is sent to qemu from the main thread context. However, the display and cursor channels, which run in different threads, can be already destroyed, together with the SpiceChannelEventInfo which is referenced in the above channel_event. I saw it when I tested my patches for 788444 769512. I Added a print in qemu when we expect SpiceChannelEventInfo with extended address flag set, and we receive the unset flag. The error msg looks like "spice: channel_event, extended address is expected". The above bug cause this msg to sometimes appear when the client disconnects, since the SpiceChannelEventInfo memory is no longer valid. I saw it when the client disconnected from a src server during migration. Reproducing the bug in this manner will be possible only after the patches for 788444 769512 are in the build.
patch upstream: commit 5ec8515508828ecf5055de220cb0cc0f3c997a27 Author: Alon Levy <alevy> Date: Wed Feb 15 15:04:04 2012 +0200 server, separate SpiceChannelEventInfo from RedStream fixes rhbz 790749 use after free of SpiceChannelEventInfo. The lifetime of the SpiceChannelEventInfo was that of RedsStream, but it is used by main_dispatcher_handle_channel_event after the RedsStream is freed for the cursor and display channels. Making SCEI allocation be at RedsStream allocation, and deallocation after the DESTROY event is processed by core->channel_event, fixes use after free.
Based on developer description, it seems like one-time fix that shouldn't be tested regularly. Alon, Yonit, if you think that this bug can regress, please reply and add 100% step-by-step reproducer.
On hosts with spice-server-0.10.1-5.el6.x86_64 and qemu-kvm-0.12.1.2-2.270.el6.x86_64, I could not see nothing similar to "spice: channel_event, extended address is expected" after successive migrations so I think this can be marked as VERIFIED now.
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. http://rhn.redhat.com/errata/RHBA-2012-0765.html