Bug 1522879

Summary: Fix crash listing nwfilters for unprivileged daemon
Product: Red Hat Enterprise Linux 7 Reporter: John Ferlan <jferlan>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED ERRATA QA Contact: yalzhang <yalzhang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.5CC: dyuan, ekultails, jinqi, lmiksik, rbalakri, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-3.9.0-6.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 11:02:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Ferlan 2017-12-06 16:31:37 UTC
Description of problem:

The unprivileged libvirtd does not support nwfilter config, but leaves the
driver active. It is supposed to result in all APIs being an effective
no-op, but several APIs rely on driver->nwfilters being non-NULL, or they
will reference a NULL pointer. Rather than adding checks for NULL in many
places, just make sure  driver->nwfilters is always initialized.

Need to backport upstream commit id 7993554f70fd8d512dfde484490bcd1601b60b33

Comment 3 yalzhang@redhat.com 2017-12-07 08:50:02 UTC
I can reproduce on libvirt-3.9.0-5.el7.x86_64

$ virsh nwfilter-list 

error: Disconnected from qemu:///session due to end of file
error: Failed to list node filters
error: Cannot recv data: Connection reset by peer

Comment 5 yalzhang@redhat.com 2017-12-14 09:13:07 UTC
verify this bug on libvirt-3.9.0-6.el7.x86_64

$ virsh nwfilter-list
 UUID                                  Name                 
------------------------------------------------------------------

$ ps -ef | grep test | grep libvirt | grep -v grep 
test     26402     1 33 17:12 ?        00:00:00 /usr/sbin/libvirtd --timeout=30

Comment 6 ekultails 2017-12-21 16:52:03 UTC
This bug also affects Fedora 27 x86_64. I was able to replicate the issue by running "virsh nwfilter-list" as a non-root user and getting the same errors as originally reported.

RPM: libvirt-3.7.0-3.fc27.x86_64

Comment 10 errata-xmlrpc 2018-04-10 11:02:08 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-2018:0704