forked from pool/libvirt
- Move hypervisor-specific files out of libvirt-daemon package
and into libvirt-daemon-<hypervisor> subpackage bnc#845851 - conf: Don't crash on invalid chardev source definition 79552754-libvirtd-chardev-crash.patch bnc#845704, rhb#1012196 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=313
This commit is contained in:
parent
b905305de1
commit
4b629b33b6
87
79552754-libvirtd-chardev-crash.patch
Normal file
87
79552754-libvirtd-chardev-crash.patch
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
commit 795527548fea79902ea4ce32747e069944cf3e61
|
||||||
|
Author: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
Date: Thu Sep 26 08:12:39 2013 +0200
|
||||||
|
|
||||||
|
conf: Don't crash on invalid chardev source definition of RNGs and other
|
||||||
|
|
||||||
|
Since commit 297c99a5 an invalid source definition XML of a character
|
||||||
|
device that is used as backend for RNG devices, smartcards and redirdevs
|
||||||
|
causes crash of the daemon when parsing such a definition.
|
||||||
|
|
||||||
|
The device types mentioned above are not a part of a regular character
|
||||||
|
device but are backends for other types. Thus when parsing such device
|
||||||
|
NULL is passed as the argument @chr_def. Later when checking the
|
||||||
|
validity of the definition @chr_def was dereferenced when parsing a UNIX
|
||||||
|
socket backend with missing path of the socket and crashed the daemon.
|
||||||
|
|
||||||
|
Sample offending configuration:
|
||||||
|
<devices>
|
||||||
|
...
|
||||||
|
<rng model='virtio'>
|
||||||
|
<backend model='egd' type='unix'>
|
||||||
|
<source mode='bind' service='1024'/>
|
||||||
|
</backend>
|
||||||
|
</rng>
|
||||||
|
</devices>
|
||||||
|
|
||||||
|
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1012196
|
||||||
|
|
||||||
|
Index: libvirt-1.1.2/src/conf/domain_conf.c
|
||||||
|
===================================================================
|
||||||
|
--- libvirt-1.1.2.orig/src/conf/domain_conf.c
|
||||||
|
+++ libvirt-1.1.2/src/conf/domain_conf.c
|
||||||
|
@@ -7026,7 +7026,8 @@ virDomainChrSourceDefParseXML(virDomainC
|
||||||
|
case VIR_DOMAIN_CHR_TYPE_UNIX:
|
||||||
|
/* path can be auto generated */
|
||||||
|
if (!path &&
|
||||||
|
- chr_def->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) {
|
||||||
|
+ (!chr_def ||
|
||||||
|
+ chr_def->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO)) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("Missing source path attribute for char device"));
|
||||||
|
goto error;
|
||||||
|
Index: libvirt-1.1.2/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd-crash.xml
|
||||||
|
===================================================================
|
||||||
|
--- /dev/null
|
||||||
|
+++ libvirt-1.1.2/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd-crash.xml
|
||||||
|
@@ -0,0 +1,27 @@
|
||||||
|
+<domain type='qemu'>
|
||||||
|
+ <name>QEMUGuest1</name>
|
||||||
|
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
+ <memory unit='KiB'>219100</memory>
|
||||||
|
+ <currentMemory unit='KiB'>219100</currentMemory>
|
||||||
|
+ <vcpu placement='static' cpuset='1-4,8-20,525'>1</vcpu>
|
||||||
|
+ <os>
|
||||||
|
+ <type arch='i686' machine='pc'>hvm</type>
|
||||||
|
+ <boot dev='hd'/>
|
||||||
|
+ </os>
|
||||||
|
+ <clock offset='utc'/>
|
||||||
|
+ <on_poweroff>destroy</on_poweroff>
|
||||||
|
+ <on_reboot>restart</on_reboot>
|
||||||
|
+ <on_crash>destroy</on_crash>
|
||||||
|
+ <devices>
|
||||||
|
+ <emulator>/usr/bin/qemu</emulator>
|
||||||
|
+ <controller type='usb' index='0'/>
|
||||||
|
+ <controller type='pci' index='0' model='pci-root'/>
|
||||||
|
+ <memballoon model='virtio'/>
|
||||||
|
+ <rng model='virtio'>
|
||||||
|
+ <backend model='egd' type='unix'>
|
||||||
|
+ <!-- https://bugzilla.redhat.com/show_bug.cgi?id=1012196 -->
|
||||||
|
+ <source mode='connect' host='1.2.3.4' service='1234'/>
|
||||||
|
+ </backend>
|
||||||
|
+ </rng>
|
||||||
|
+ </devices>
|
||||||
|
+</domain>
|
||||||
|
Index: libvirt-1.1.2/tests/qemuxml2argvtest.c
|
||||||
|
===================================================================
|
||||||
|
--- libvirt-1.1.2.orig/tests/qemuxml2argvtest.c
|
||||||
|
+++ libvirt-1.1.2/tests/qemuxml2argvtest.c
|
||||||
|
@@ -973,6 +973,8 @@ mymain(void)
|
||||||
|
QEMU_CAPS_OBJECT_RNG_RANDOM);
|
||||||
|
DO_TEST("virtio-rng-egd", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_RNG,
|
||||||
|
QEMU_CAPS_OBJECT_RNG_EGD);
|
||||||
|
+ DO_TEST_PARSE_ERROR("virtio-rng-egd-crash", QEMU_CAPS_DEVICE,
|
||||||
|
+ QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_EGD);
|
||||||
|
DO_TEST("virtio-rng-ccw",
|
||||||
|
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
|
||||||
|
QEMU_CAPS_DRIVE, QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_CCW,
|
@ -1,3 +1,13 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 18 14:42:39 MDT 2013 - jfehlig@suse.com
|
||||||
|
|
||||||
|
- Move hypervisor-specific files out of libvirt-daemon package
|
||||||
|
and into libvirt-daemon-<hypervisor> subpackage
|
||||||
|
bnc#845851
|
||||||
|
- conf: Don't crash on invalid chardev source definition
|
||||||
|
79552754-libvirtd-chardev-crash.patch
|
||||||
|
bnc#845704, rhb#1012196
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Oct 17 14:14:46 MDT 2013 - jfehlig@suse.com
|
Thu Oct 17 14:14:46 MDT 2013 - jfehlig@suse.com
|
||||||
|
|
||||||
|
85
libvirt.spec
85
libvirt.spec
@ -411,6 +411,7 @@ Patch4: 922b7fda-CVE-2013-4311.patch
|
|||||||
Patch5: e4697b92-CVE-2013-4311.patch
|
Patch5: e4697b92-CVE-2013-4311.patch
|
||||||
Patch6: 8294aa0c-CVE-2013-4399.patch
|
Patch6: 8294aa0c-CVE-2013-4399.patch
|
||||||
Patch7: 484cc321-fix-spice-migration.patch
|
Patch7: 484cc321-fix-spice-migration.patch
|
||||||
|
Patch8: 79552754-libvirtd-chardev-crash.patch
|
||||||
# Need to go upstream
|
# Need to go upstream
|
||||||
Patch100: xen-name-for-devid.patch
|
Patch100: xen-name-for-devid.patch
|
||||||
Patch101: clone.patch
|
Patch101: clone.patch
|
||||||
@ -926,6 +927,7 @@ of recent versions of Linux (and other OSes).
|
|||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
%patch6 -p1
|
%patch6 -p1
|
||||||
%patch7 -p1
|
%patch7 -p1
|
||||||
|
%patch8 -p1
|
||||||
%patch100 -p1
|
%patch100 -p1
|
||||||
%patch101
|
%patch101
|
||||||
%patch102 -p1
|
%patch102 -p1
|
||||||
@ -1193,34 +1195,19 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
|
|||||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter
|
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter
|
||||||
rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so
|
rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so
|
||||||
%endif
|
%endif
|
||||||
%if %{with_lxc}
|
%if ! %{with_lxc}
|
||||||
cat > $RPM_BUILD_ROOT%{_docdir}/libvirt/libvirt-daemon-lxc.README << 'EOF'
|
|
||||||
Any empty package encapsulating requirements for a libvirtd capable
|
|
||||||
of managing LXC.
|
|
||||||
EOF
|
|
||||||
%else
|
|
||||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
|
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
|
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
|
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
|
||||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
|
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
|
||||||
%endif
|
%endif
|
||||||
%if %{with_qemu}
|
%if ! %{with_qemu}
|
||||||
cat > $RPM_BUILD_ROOT%{_docdir}/libvirt/libvirt-daemon-qemu.README << 'EOF'
|
|
||||||
Any empty package encapsulating requirements for a libvirtd capable
|
|
||||||
of managing QEMU/KVM.
|
|
||||||
EOF
|
|
||||||
%else
|
|
||||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
|
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
|
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
|
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
|
||||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
|
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
|
||||||
%endif
|
%endif
|
||||||
%if %{with_uml}
|
%if ! %{with_uml}
|
||||||
cat > $RPM_BUILD_ROOT%{_docdir}/libvirt/libvirt-daemon-uml.README << 'EOF'
|
|
||||||
Any empty package encapsulating requirements for a libvirtd capable
|
|
||||||
of managing UML.
|
|
||||||
EOF
|
|
||||||
%else
|
|
||||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
|
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
|
||||||
%endif
|
%endif
|
||||||
%if %{with_vbox}
|
%if %{with_vbox}
|
||||||
@ -1229,12 +1216,6 @@ Any empty package encapsulating requirements for a libvirtd capable
|
|||||||
of managing VirtualBox.
|
of managing VirtualBox.
|
||||||
EOF
|
EOF
|
||||||
%endif
|
%endif
|
||||||
%if %{with_xen} || %{with_libxl}
|
|
||||||
cat > $RPM_BUILD_ROOT%{_docdir}/libvirt/libvirt-daemon-xen.README << 'EOF'
|
|
||||||
Any empty package encapsulating requirements for a libvirtd capable
|
|
||||||
of managing Xen.
|
|
||||||
EOF
|
|
||||||
%endif
|
|
||||||
%if ! %{with_sanlock}
|
%if ! %{with_sanlock}
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirt_sanlock.aug
|
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirt_sanlock.aug
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
|
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
|
||||||
@ -1414,36 +1395,6 @@ fi
|
|||||||
%{_datadir}/PolicyKit/policy/org.libvirt.unix.policy
|
%{_datadir}/PolicyKit/policy/org.libvirt.unix.policy
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
%if %{with_qemu}
|
|
||||||
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
|
|
||||||
%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
|
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
|
|
||||||
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
|
|
||||||
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
|
|
||||||
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/
|
|
||||||
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/target/
|
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
|
|
||||||
%{_datadir}/augeas/lenses/libvirtd_qemu.aug
|
|
||||||
%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
|
|
||||||
%endif
|
|
||||||
%if %{with_lxc}
|
|
||||||
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
|
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
|
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
|
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
|
|
||||||
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_lxc
|
|
||||||
%{_datadir}/augeas/lenses/libvirtd_lxc.aug
|
|
||||||
%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
|
|
||||||
%endif
|
|
||||||
%if %{with_uml}
|
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
|
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/
|
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
|
|
||||||
%endif
|
|
||||||
%if %{with_libxl}
|
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
|
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
|
|
||||||
%endif
|
|
||||||
%if %{with_storage_disk}
|
%if %{with_storage_disk}
|
||||||
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_parthelper
|
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_parthelper
|
||||||
%endif
|
%endif
|
||||||
@ -1567,28 +1518,46 @@ fi
|
|||||||
|
|
||||||
%files daemon-qemu
|
%files daemon-qemu
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc %{_docdir}/%{name}/libvirt-daemon-qemu.README
|
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
|
||||||
|
%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
|
||||||
|
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
|
||||||
|
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
|
||||||
|
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
|
||||||
|
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/
|
||||||
|
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/channel/target/
|
||||||
|
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
|
||||||
|
%{_datadir}/augeas/lenses/libvirtd_qemu.aug
|
||||||
|
%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_lxc}
|
%if %{with_lxc}
|
||||||
|
|
||||||
%files daemon-lxc
|
%files daemon-lxc
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc %{_docdir}/%{name}/libvirt-daemon-lxc.README
|
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
|
||||||
|
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
|
||||||
|
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
|
||||||
|
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
|
||||||
|
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_lxc
|
||||||
|
%{_datadir}/augeas/lenses/libvirtd_lxc.aug
|
||||||
|
%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_uml}
|
%if %{with_uml}
|
||||||
|
|
||||||
%files daemon-uml
|
%files daemon-uml
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc %{_docdir}/%{name}/libvirt-daemon-uml.README
|
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
|
||||||
|
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/
|
||||||
|
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_xen} || %{with_libxl}
|
%if %{with_xen} || %{with_libxl}
|
||||||
|
|
||||||
%files daemon-xen
|
%files daemon-xen
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc %{_docdir}/%{name}/libvirt-daemon-xen.README
|
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
|
||||||
|
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_vbox}
|
%if %{with_vbox}
|
||||||
|
Loading…
Reference in New Issue
Block a user