Bug 802644

Summary: segfault when attempting to detach non-existent network device
Product: Red Hat Enterprise Linux 6 Reporter: Laine Stump <laine>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: acathrow, ajia, dallan, dyuan, honzhang, mshao, mzhan, rwu, weizhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.10-6.el6 Doc Type: Bug Fix
Doc Text:
(This bug was never in a released version of libvirt, so no thecnical note is required)
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 06:50:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Laine Stump 2012-03-13 07:32:36 UTC
The patches for Bug 691539 introduced a regression in network device detach. A fix has been pushed upstream, and needs to be backported to RHEL:

commit 19c7980ee6ca94308313b440fd39f308b4ae844e
Author: Guannan Ren <gren>
Date:   Mon Mar 12 23:50:02 2012 +0800

    qemu: fix segfault when detaching non-existent network device
    
    In qemuDomainDetachNetDevice, detach was being used before it had been
    validated. If no matching device was found, this resulted in a
    dereference of a NULL pointer.
    
    This behavior was a regression introduced in commit
    cf90342be0022520e25cfa258cef1034b229a100, so it has not been a part of
    any official libvirt release.

Comment 1 Laine Stump 2012-03-16 14:23:47 UTC
A backported fix has been posted to rhvirt-patches for inclusion in the RHEL build of libvirt:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-March/msg01463.html

Comment 4 hongming 2012-03-20 07:03:57 UTC
Use libvirt-0.9.10-4.el6.x86_64 to reproduce the bug.
#virsh detach-device rhel6 net.xml
error: Failed to detach device from net.xml
error: End of file while reading data:Input/Output error


Verify steps

1.# rpm -q libvirt
libvirt-0.9.10-6.el6.x86_64

2.Prepare the following xml.
<interface type='user'>
<mac address='02:11:22:33:44:55'/>
<model type='virtio'/>
</interface>
 
3.# virsh attach-device rhel6 net.xml
Device attached successfully

4.# virsh detach-device rhel6 net.xml
Device detached successfully

5.# virsh detach-device rhel6 net.xml
error: Failed to detach device from /home/net.xml
error: operation failed: network device 02:11:22:33:44:55 not found

So it is verified.

Comment 5 Laine Stump 2012-05-08 18:56:44 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
(This bug was never in a released version of libvirt, so no thecnical note is required)

Comment 7 errata-xmlrpc 2012-06-20 06:50:03 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.

http://rhn.redhat.com/errata/RHSA-2012-0748.html