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 1169409 - Libvirt will crash with segfault if you try to set non-existing nwfilter to network interface for live guest
Summary: Libvirt will crash with segfault if you try to set non-existing nwfilter to n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1143780 1202703
TreeView+ depends on / blocked
 
Reported: 2014-12-01 15:17 UTC by Pavel Hrdina
Modified: 2015-03-17 09:22 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.8-11.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1202703 (view as bug list)
Environment:
Last Closed: 2015-03-05 07:47:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Pavel Hrdina 2014-12-01 15:17:51 UTC
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 16:24:42 UTC
Upstream patch posted:

https://www.redhat.com/archives/libvir-list/2014-December/msg00084.html

Comment 2 Pavel Hrdina 2014-12-02 10:13:52 UTC
commit d98ad8dd0c5a1d9f6a804e23f0568c784469c3fd
Author: Pavel Hrdina <phrdina>
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>

Comment 5 Hu Jianwei 2014-12-23 02:33:46 UTC
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 07:47:52 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/RHSA-2015-0323.html


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