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 1434882 - Don't SIGSEGV on domain destroy
Summary: Don't SIGSEGV on domain destroy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-22 14:36 UTC by Michal Privoznik
Modified: 2017-08-02 00:03 UTC (History)
3 users (show)

Fixed In Version: libvirt-3.2.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:24:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Michal Privoznik 2017-03-22 14:36:32 UTC
Description of problem:
Due to my work related to bug 1325996 I've mistakenly introduced a crasher.

Version-Release number of selected component (if applicable):
libvirt-3.1.0-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. virsh net-start default
2. virsh start myFavouriteDomain
3. virsh net-destroy default
4. virsh destroy myFavouriteDomain

Where 'default' network can be any libvirt network in 'nat' or 'isolated' modes and 'myFavouriteDomain' has an interface from the network.

Actual results:
libvirtd crashes.

Expected results:
libvirtd does not crash.


Additional info:

Comment 1 Michal Privoznik 2017-03-22 14:44:43 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2017-March/msg01004.html

Comment 2 yalzhang@redhat.com 2017-03-23 08:35:58 UTC
reproduce it on libvirt-3.1.0-2.el7.x86_64

# ps aux | grep libvirtd
root      1366  0.6  0.3 1872896 29832 ?       Ssl  16:28   0:01 /usr/sbin/libvirtd

# virsh net-destroy default
Network default destroyed

# virsh destroy rhel7.3
error: Disconnected from qemu:///system due to I/O error
error: Failed to destroy domain rhel7.3
error: End of file while reading data: Input/output error

# ps aux | grep libvirtd
root      5528  4.4  0.3 1946264 28464 ?       Ssl  16:32   0:00 /usr/sbin/libvirtd

Comment 3 Michal Privoznik 2017-03-29 07:51:20 UTC
Patch pushed upstream:

commit 2fe93123bfb6e3bc373b3cc70c60522235c9c931
Author:     Michal Privoznik <mprivozn>
AuthorDate: Wed Mar 22 13:07:14 2017 +0100
Commit:     Michal Privoznik <mprivozn>
CommitDate: Wed Mar 29 09:29:35 2017 +0200

    network: Don't crash on domain destroy
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1434882
    
    Imagine the following scenario:
    
    1) virsh net-start default
    2) virsh start myFavouriteDomain
    3) virsh net-destroy default
    4) virsh destroy myFavouriteDomain
    
    (assuming myFavouriteDomain has an interface from default
    network)
    
    Regardless of how unlikely this scenario looks like, we should
    not crash. The problem is, on net-destroy in
    networkShutdownNetworkVirtual() the virMacMap module is unrefed,
    but the stale pointer is kept around. Thus when the domain
    destroy procedure comes in, networkReleaseActualDevice() and
    subsequently networkMacMgrDel() is called. This function sees the
    stale pointer and starts calling the virMacMap module APIs which
    work over freed memory.
    
    Signed-off-by: Michal Privoznik <mprivozn>

Comment 5 yalzhang@redhat.com 2017-04-05 08:23:06 UTC
verified this bug on libvirt-3.2.0-1.el7.x86_64, the result is as expected, set this bug to verified.

1. 
# virsh start rhel7.4
Domain rhel7.4 started
# virsh dumpxml rhel7.4 | grep /interface -B7
    <interface type='network'>
      <mac address='52:54:00:86:73:fa'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
# pidof libvirtd
2259

2. destroy the vm after the network in use is destroyed, libvirtd do not crash.
# virsh net-destroy default
Network default destroyed

# virsh destroy rhel7.4
Domain rhel7.4 destroyed

# pidof libvirtd
2259

Comment 6 errata-xmlrpc 2017-08-01 17:24:15 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://access.redhat.com/errata/RHEA-2017:1846

Comment 7 errata-xmlrpc 2017-08-02 00:03:43 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://access.redhat.com/errata/RHEA-2017:1846


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