Bug 802644 - segfault when attempting to detach non-existent network device
Summary: segfault when attempting to detach non-existent network device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-13 07:32 UTC by Laine Stump
Modified: 2012-06-20 06:50 UTC (History)
9 users (show)

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)
Clone Of:
Environment:
Last Closed: 2012-06-20 06:50:03 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

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


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