RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1281455 - use-after-free at hard VM reset (virsh reset/system_reset)
Summary: use-after-free at hard VM reset (virsh reset/system_reset)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: spice
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Victor Toso
QA Contact: SPICE QE bug list
URL:
Whiteboard:
: 1330394 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-12 14:57 UTC by David Jaša
Modified: 2019-12-16 05:05 UTC (History)
5 users (show)

Fixed In Version: spice-0.12.4-17.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 03:44:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
symbolized output, log snippet & full backtrace (33.08 KB, text/plain)
2015-11-12 14:57 UTC, David Jaša
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2324 0 normal SHIPPED_LIVE spice bug fix and enhancement update 2016-11-03 13:43:33 UTC

Description David Jaša 2015-11-12 14:57:51 UTC
Created attachment 1093345 [details]
symbolized output, log snippet & full backtrace

Description of problem:
When running address sanitizer-instrumented qemu and spice-server, I encountered use-after free during hard system reset (triggered by qemu command system_reset)

Version-Release number of selected component (if applicable):
spice-server-0.12.4-15.el7.sanitizer.x86_64
qemu-kvm-rhev 

How reproducible:
didn't try to reproduce

Steps to Reproduce:
1. I rebuilt qemu-kvm and spice-server with address sanitizer enabled
2. I got BSOD in windows VM, so I used qemu's system_reset to get back faster
3. right after VM reset, ASAN detected use-after-free

Actual results:
==10014== ERROR: AddressSanitizer: heap-use-after-free on address 0x600c002c2830 at pc 0x7fffee3887bc bp 0x7fffffffccd0 sp 0x7fffffffccc0
[Thread 0x7fff7acf9700 (LWP 10051) exited]
READ of size 4 at 0x600c002c2830 thread T0
[Thread 0x7fff5d118700 (LWP 10841) exited]
[Thread 0x7fff5fe45700 (LWP 10286) exited]
[Thread 0x7fff5e726700 (LWP 10839) exited]
    #0 0x7fffee3887bb in spice_char_device_client_free /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/char_device.c:166
    #2 0x7fffee38bdfb in spice_char_device_state_destroy /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/char_device.c:712
    #4 0x7fffee43cb09 in reds_reset_vdp /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/reds.c:512
    #5 0x7fffee43cb09 in reds_agent_remove /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/reds.c:683
...
0x600c002c2830 is located 16 bytes inside of 56-byte region [0x600c002c2820,0x600c002c2858)
freed by thread T0 here:
    #2 0x7fffee38bf74 in spice_char_device_write_buffer_free /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/char_device.c:693
    #3 0x7fffee38bf74 in spice_char_device_state_destroy /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/char_device.c:704
    #5 0x7fffee43cb09 in reds_reset_vdp /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/reds.c:512
    #6 0x7fffee43cb09 in reds_agent_remove /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/reds.c:683
...
previously allocated by thread T0 here:
    #2 0x7fffee4bc99f in spice_malloc0 /home/djasa/rpmbuild/BUILD/spice-0.12.4/spice-common/common/mem.c:109
    #4 0x7fffee3875f1 in __spice_char_device_write_buffer_get /home/djasa/rpmbuild/BUILD/spice-0.12.4/server/char_device.c:510
...

Expected results:
no use-after-free occurs

Additional info:
virtio-scsi has to be used for block device because virtio-blk uses coroutines that are incompatible with address sanitizer

Comment 1 Victor Toso 2015-11-13 10:18:48 UTC
Sent some patches which should fix it:
http://lists.freedesktop.org/archives/spice-devel/2015-November/023565.html

Comment 2 David Jaša 2015-11-13 10:33:46 UTC
I wasn't able to reproduce at subsequent retries. The fact that system boot takes 20-30 minutes with asan-enabled qemu isn't exactly helpful either.

Comment 4 Victor Toso 2015-11-13 11:13:12 UTC
Patches pushed upstream related to this:

c429574bb6aebcbbddcc9714f994afd6b0ae7186
08230ee1715ff07bb0bdc8e6661b53a6752854d5

The following patch seems necessary as well:

d7bee1bc56e2d3ea6af399ba8479cb4b849d4b15

Comment 5 Mike McCune 2016-03-28 23:43:17 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 Victor Toso 2016-05-10 07:00:10 UTC
*** Bug 1330394 has been marked as a duplicate of this bug. ***

Comment 10 errata-xmlrpc 2016-11-04 03:44:06 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/RHBA-2016-2324.html


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