Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1169409 - Libvirt will crash with segfault if you try to set non-existing nwfilter to network interface for live guest
Libvirt will crash with segfault if you try to set non-existing nwfilter to n...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Pavel Hrdina
Virtualization Bugs
:
Depends On:
Blocks: 1143780 1202703
  Show dependency treegraph
 
Reported: 2014-12-01 10:17 EST by Pavel Hrdina
Modified: 2015-03-17 05:22 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-1.2.8-11.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1202703 (view as bug list)
Environment:
Last Closed: 2015-03-05 02:47:52 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Pavel Hrdina 2014-12-01 10:17:51 EST
See the summary.

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

How reproducible:
100%

Steps to Reproduce:
1. create a guest with network interface
2. start the guest
3. create a xml configuration for the interface with non-existing nwfilter:

cat nic2.xml

<interface type='network'>
  <mac address='52:54:00:3c:f1:8d'/>
  <source network='default'/>
  <model type='virtio'/>
  <target dev='vnet0'/>
  <filterref filter='clean-traffic-non-exist'/>
</interface>

4. run 'virsh update-device jeos nic2.xml'


Actual results:
error: Failed to update device from nic2.xml
error: End of file while reading data: Input/output error
error: Failed to reconnect to the hypervisor

and the daemon will crash with segfault

Expected results:
error: Failed to update device from nic.xml
error: operation failed: failed to add new filter rules to 'vnet0' - attempting to restore old rules
Comment 1 Pavel Hrdina 2014-12-01 11:24:42 EST
Upstream patch posted:

https://www.redhat.com/archives/libvir-list/2014-December/msg00084.html
Comment 2 Pavel Hrdina 2014-12-02 05:13:52 EST
commit d98ad8dd0c5a1d9f6a804e23f0568c784469c3fd
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Mon Dec 1 17:23:00 2014 +0100

    nwfilter: fix crash when adding non-existing nwfilter
    
    Adding non-existing nwfilter to a network interface device without any
    nwfilter specified will crash libvirt daemon with segfault. The reason is
    that the nwfilter is not found an libvirt will try to restore old
    nwfilter configuration but there is no nwfilter specified.
    
    Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Comment 5 Hu Jianwei 2014-12-22 21:33:46 EST
I can not reproduce it on below version.

[root@ibm-x3850x5-06 ~]# rpm -q libvirt qemu-kvm-rhev
libvirt-1.2.8-11.el7.x86_64
qemu-kvm-rhev-2.1.2-17.el7.x86_64


[root@ibm-x3850x5-06 ~]# cat nic3.xml 
<interface type='network'>
  <mac address='02:54:00:36:c6:d0'/>
  <source network='default' bridge='virbr0'/>
  <target dev='vnet0'/>
  <model type='virtio'/>
  <alias name='net0'/>
  <filterref filter='clean-traffic-non-exist'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

[root@ibm-x3850x5-06 ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 37    r7                             running

[root@ibm-x3850x5-06 ~]# service libvirtd status
Redirecting to /bin/systemctl status  libvirtd.service
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Fri 2014-12-19 16:45:50 CST; 3 days ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 14355 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           ├─ 2742 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --dhcp-script=/usr/libexec/libvirt_leaseshelper
           ├─ 2743 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --dhcp-script=/usr/libexec/libvirt_leaseshelper
           └─14355 /usr/sbin/libvirtd

...

[root@ibm-x3850x5-06 ~]# virsh update-device r7 nic3.xml 
error: Failed to update device from nic3.xml
error: operation failed: failed to add new filter rules to 'vnet0' - attempting to restore old rules

[root@ibm-x3850x5-06 ~]# virsh update-device r7 nic3.xml 
error: Failed to update device from nic3.xml
error: operation failed: failed to add new filter rules to 'vnet0' - attempting to restore old rules
[root@ibm-x3850x5-06 ~]# service libvirtd status
Redirecting to /bin/systemctl status  libvirtd.service
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Fri 2014-12-19 16:45:50 CST; 3 days ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 14355 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           ├─ 2742 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --dhcp-script=/usr/libexec/libvirt_leaseshelper
           ├─ 2743 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --dhcp-script=/usr/libexec/libvirt_leaseshelper
           └─14355 /usr/sbin/libvirtd
...

Move to Verified.
Comment 7 errata-xmlrpc 2015-03-05 02:47:52 EST
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/RHSA-2015-0323.html

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