Bug 2102009
| Summary: | Attach interface fail will cause unexpected behavior | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | yalzhang <yalzhang> | ||||
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> | ||||
| libvirt sub component: | Networking | QA Contact: | yalzhang <yalzhang> | ||||
| Status: | CLOSED ERRATA | Docs Contact: | |||||
| Severity: | unspecified | ||||||
| Priority: | unspecified | CC: | jdenemar, jsuchane, lvivier, virt-maint | ||||
| Version: | 9.1 | Keywords: | Automation, Regression, Triaged, Upstream | ||||
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | libvirt-8.5.0-1.el9 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2022-11-15 10:04:39 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: | 8.5.0 | ||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
Attach interface fail will cause such issue, another reproduce: # cat interface.xml <interface type="network"> <source network="default" /> <filterref filter="noexist-filter" /> <model type="virtio" /> </interface> # pidof virtqemud 52745 # virsh attach-device avocado-vt-vm1 interface.xml error: Failed to attach device from interface.xml error: internal error: referenced filter 'noexist-filter' is missing # virsh destroy avocado-vt-vm1 Domain 'avocado-vt-vm1' destroyed # systemctl restart virtqemud # coredumpctl list | grep 52745 Wed 2022-06-29 18:34:23 CST 52745 0 0 SIGABRT present /usr/sbin/virtqemud 1.0M Michal, please have a look. Thanks. Patch posted here: https://listman.redhat.com/archives/libvir-list/2022-July/232668.html Merged upstream as:
commit f3f877cfa6ff444b0c26c8f987bfe60634d0a600
Author: Michal Prívozník <mprivozn>
AuthorDate: Fri Jul 1 09:03:28 2022 +0200
Commit: Michal Prívozník <mprivozn>
CommitDate: Fri Jul 1 10:45:26 2022 +0200
qemu_hotplug: Don't skip cleanup in qemuDomainAttachNetDevice()
Introduced in v8.4.0-rc1~183 but the first real problem
introduced in v8.4.0-rc1~170, there's a
qemuBuildInterfaceConnect() call inside of
qemuDomainAttachNetDevice(). If the former fails, then the
function is immediately returned from instead of jumping onto the
cleanup label. This is crucial, because at this point the domain
definition contains 'borrowed' net definition, which is then
freed, since an error was met. The domain definition is then left
with a dangling pointer which leads to all sorts of different
crashes.
Fixes: 29d022b1eb7b2330ed224a08509e6d3a5eeecc53
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2102009
Signed-off-by: Michal Privoznik <mprivozn>
Reviewed-by: Jiri Denemark <jdenemar>
v8.5.0-rc2-7-gf3f877cfa6
Test with libvirt-8.5.0-1.el9.x86_64 and comment 1, the issue is fixed. # pidof virtqemud 58724 # virsh attach-device avocado-vt-vm1 interface.xml error: Failed to attach device from interface.xml error: internal error: referenced filter 'noexist-filter' is missing # virsh dumpxml avocado-vt-vm1 | grep /interface -B7 <interface type='network'> <mac address='52:54:00:7b:3c:c9'/> <source network='default' portid='80515b34-12f1-4312-9a46-8ac7ae1744bc' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> # systemctl restart virtqemud # coredumpctl list | grep 58724 (no outputs) Test with the same steps in comment 7 with libvirt-8.5.0-1.el9.x86_64, the issue is fixed. 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 (Low: libvirt security, bug fix, and enhancement update), 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/RHSA-2022:8003 |
Created attachment 1893327 [details] virtqemud coredump file Description of problem: Attach ovs bridge type interface without virtualport type cause unexpected behavior Version-Release number of selected component (if applicable): libvirt-8.4.0-3.el9.x86_64 How reproducible: 100% Steps to Reproduce: 1. Create an openvswitch type bridge: # ovs-vsctl add-br ovsbr0 # ovs-vsctl show fe232443-05ec-475e-baf4-89a14b012b30 Bridge ovsbr0 Port ovsbr0 Interface ovsbr0 type: internal ovs_version: "2.15.6" 2. start a vm, and try to attach a bridge type interface which connected to an ovs bridge: # virsh start avocado-vt-vm1 Domain 'avocado-vt-vm1' started # pidof virtqemud 31938 # virsh attach-interface avocado-vt-vm1 bridge ovsbr0 --model virtio error: Failed to attach interface error: Unable to add bridge ovsbr0 port vnet4: Operation not supported This is expected, since ovsbr0 is an ovs bridge which needs to set the <virtualport type='openvswitch'/> in the interface device xml. But after the command, the dumpxml will fail with error as below # virsh dumpxml avocado-vt-vm1 error: internal error: unexpected net type -50053111 4. Destroy the vm and then restart the virtqemud service. It will cause Virtqemud coredump. # virsh destroy avocado-vt-vm1 Domain 'avocado-vt-vm1' destroyed # pidof virtqemud 31938 # systemctl restart virtqemud # coredumpctl list Wed 2022-06-29 13:39:42 CST 31938 0 0 SIGABRT present /usr/sbin/virtqemud 1.0M Actual results: step 3, the dumpxml show unexpected error msg; step 4, restart virtqemud will trigger virtqemud coredump. Expected results: In step 3, it should show the vm's live xml without the interface, and in step 4, there should be no coredump triggered Additional info: The issue occur since libvirt-8.4.0-1.el9.x86_64, no issue for libvirt-8.3.0-1.el9.x86_64 # rpm -q libvirt libvirt-8.3.0-1.el9.x86_64 # pidof virtqemud; virsh start avocado-vt-vm1; virsh attach-interface avocado-vt-vm1 bridge ovsbr0 --model virtio; sleep 2; virsh dumpxml avocado-vt-vm1 | grep /interface -B7; virsh destroy avocado-vt-vm1; systemctl restart virtqemud; 42516 Domain 'avocado-vt-vm1' started error: Failed to attach interface error: Unable to add bridge ovsbr0 port vnet1: Operation not supported <interface> <mac address='52:54:00:7b:3c:c9'/> <source network='default' portid='b27959f5-4535-40a8-9ff1-7ecc19e2fc61' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> Domain 'avocado-vt-vm1' destroyed # coredumpctl list | grep 42516 # (no outputs)