All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] libvirt: fix libvirtd crash if path part of URI is missing
@ 2013-06-28 17:26 Mark Asselstine
  2013-06-28 17:26 ` [PATCH 2/3] libvirt: use 4 fields for PACKAGECONFIG[] Mark Asselstine
  2013-06-28 18:10 ` [PATCH 1/3] libvirt: fix libvirtd crash if path part of URI is missing Bruce Ashfield
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Asselstine @ 2013-06-28 17:26 UTC (permalink / raw)
  To: bruce.ashfield, meta-virtualization

From: thomas tai <ttai@ala-lpd-test3.wrs.com>

If the user forgets to include the path portion of the URI, instead of
receiving an error message, libvirtd crashes.

So for example attempting to make this call will cause libvirtd to
fall over.

virsh -c qemu+ssh://root@my.host.com list
(forgetting the trailing /system after the host name)

The reason for the crash is that libvirtd is trying to output an error
message with a uninitialized variable. This problem is already fixed
in the upstream so applying this fix to our tree allows this issue to
be avoided.

Signed-off-by: Thomas Tai <thomas.tai@windriver.com>
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 .../libvirt/qemu-fix-crash-in-qemuOpen.patch       | 39 ++++++++++++++++++++++
 recipes-extended/libvirt/libvirt_1.0.3.bb          |  5 +--
 2 files changed, 42 insertions(+), 2 deletions(-)
 create mode 100644 recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch

diff --git a/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch
new file mode 100644
index 0000000..3cf9e83
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch
@@ -0,0 +1,39 @@
+From 74bff2509080912ea8abf1de8fd95fa2412b659a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
+Date: Thu, 11 Apr 2013 11:37:25 +0200
+Subject: [PATCH] qemu: fix crash in qemuOpen
+
+commit 74bff2509080912ea8abf1de8fd95fa2412b659a from upsteam
+git://libvirt.org/libvirt.git
+
+If the path part of connection URI is not present, cfg is used
+unitialized.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=950855
+---
+ src/qemu/qemu_driver.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
+index 2c0d7d1..0d41e39 100644
+--- a/src/qemu/qemu_driver.c
++++ b/src/qemu/qemu_driver.c
+@@ -1026,6 +1026,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
+             goto cleanup;
+         }
+ 
++        cfg = virQEMUDriverGetConfig(qemu_driver);
+         if (conn->uri->path == NULL) {
+             virReportError(VIR_ERR_INTERNAL_ERROR,
+                            _("no QEMU URI path given, try %s"),
+@@ -1033,7 +1034,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
+             goto cleanup;
+         }
+ 
+-        cfg = virQEMUDriverGetConfig(qemu_driver);
+         if (cfg->privileged) {
+             if (STRNEQ(conn->uri->path, "/system") &&
+                 STRNEQ(conn->uri->path, "/session")) {
+-- 
+1.7.1
+
diff --git a/recipes-extended/libvirt/libvirt_1.0.3.bb b/recipes-extended/libvirt/libvirt_1.0.3.bb
index 768ccc8..845baf5 100644
--- a/recipes-extended/libvirt/libvirt_1.0.3.bb
+++ b/recipes-extended/libvirt/libvirt_1.0.3.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://libvirt.org"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=fb919cc88dbe06ec0b0bd50e001ccf1f"
 SECTION = "console/tools"
-PR = "r6"
+PR = "r7"
 
 DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \
 	   iptables ebtables dnsmasq readline"
@@ -25,7 +25,8 @@ RCONFLICTS_${PN}_libvirtd = "connman"
 SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz \
   file://libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch \
 	file://libvirtd.sh \
-	file://libvirtd.conf"
+	file://libvirtd.conf \
+	file://qemu-fix-crash-in-qemuOpen.patch "
 
 SRC_URI[md5sum] = "3d9f85d586c9aa3d819b626622f3fc97"
 SRC_URI[sha256sum] = "f64f4acd7cdcfc6ab5e803195ed58b949f262b54e3659d8c37b33f0fec112757"
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] libvirt: use 4 fields for PACKAGECONFIG[]
  2013-06-28 17:26 [PATCH 1/3] libvirt: fix libvirtd crash if path part of URI is missing Mark Asselstine
@ 2013-06-28 17:26 ` Mark Asselstine
  2013-06-28 17:26   ` [PATCH 3/3] libvirt: make ebtables a PACKAGECONFIG Mark Asselstine
  2013-06-28 18:10 ` [PATCH 1/3] libvirt: fix libvirtd crash if path part of URI is missing Bruce Ashfield
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Asselstine @ 2013-06-28 17:26 UTC (permalink / raw)
  To: bruce.ashfield, meta-virtualization

From: Joe Slater <jslater@windriver.com>

As per the PACKAGECONFIG documentation "You can omit any argument you
like but must retain the separating commas".

If we do not retain the separating commas, we might get parsing
errors, or, worse, we will think we depend on many items that we do
not enable.

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 recipes-extended/libvirt/libvirt_1.0.3.bb | 38 ++++++++++++++++---------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/recipes-extended/libvirt/libvirt_1.0.3.bb b/recipes-extended/libvirt/libvirt_1.0.3.bb
index 845baf5..fb4b9bb 100644
--- a/recipes-extended/libvirt/libvirt_1.0.3.bb
+++ b/recipes-extended/libvirt/libvirt_1.0.3.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://libvirt.org"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=fb919cc88dbe06ec0b0bd50e001ccf1f"
 SECTION = "console/tools"
-PR = "r7"
+PR = "r8"
 
 DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \
 	   iptables ebtables dnsmasq readline"
@@ -115,29 +115,31 @@ INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72"
 PACKAGECONFIG ??= "qemu yajl xen libxl xen-inotify uml openvz vmware vbox esx \
 	           polkit lxc test remote macvtap libvirtd netcf udev python ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
 
-PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu"
+# enable,disable,depends,rdepends
+#
+PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu,"
 PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl"
-PACKAGECONFIG[xen] = "--with-xen,--without-xen,xen"
-PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi"
-PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,xen"
-PACKAGECONFIG[xen-inotify] = "--with-xen-inotify,--without-xen-inotify,xen"
-PACKAGECONFIG[uml] = "--with-uml, --without-uml"
-PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz"
-PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware"
-PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp"
-PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox"
-PACKAGECONFIG[esx] = "--with-esx,--without-esx"
-PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv"
+PACKAGECONFIG[xen] = "--with-xen,--without-xen,xen,"
+PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,,"
+PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,xen,"
+PACKAGECONFIG[xen-inotify] = "--with-xen-inotify,--without-xen-inotify,xen,"
+PACKAGECONFIG[uml] = "--with-uml, --without-uml,,"
+PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,,"
+PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,,"
+PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,,"
+PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,,"
+PACKAGECONFIG[esx] = "--with-esx,--without-esx,,"
+PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,,"
 PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit"
-PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc"
-PACKAGECONFIG[test] = "--with-test=yes,--with-test=no"
-PACKAGECONFIG[remote] = "--with-remote,--without-remote"
+PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc,"
+PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,,"
+PACKAGECONFIG[remote] = "--with-remote,--without-remote,,"
 PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl"
-PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd"
+PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,,"
 PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf"
 PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,,"
 PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess,"
-PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
+PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
 # Enable the Python tool support
 require libvirt-python.inc
 
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] libvirt: make ebtables a PACKAGECONFIG
  2013-06-28 17:26 ` [PATCH 2/3] libvirt: use 4 fields for PACKAGECONFIG[] Mark Asselstine
@ 2013-06-28 17:26   ` Mark Asselstine
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Asselstine @ 2013-06-28 17:26 UTC (permalink / raw)
  To: bruce.ashfield, meta-virtualization

This is a bit ugly since ebtables isn't controlled via
--with/--without-PACKAGE but we can achieve the same result using the
cached path variable. Since there are no static hooks into ebtables it
doesn't get picked up via the automatic RDEPENDS so we also ensure
that we add the RDEPENDS explicitly here.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 recipes-extended/libvirt/libvirt_1.0.3.bb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/recipes-extended/libvirt/libvirt_1.0.3.bb b/recipes-extended/libvirt/libvirt_1.0.3.bb
index fb4b9bb..0d1d081 100644
--- a/recipes-extended/libvirt/libvirt_1.0.3.bb
+++ b/recipes-extended/libvirt/libvirt_1.0.3.bb
@@ -3,10 +3,10 @@ HOMEPAGE = "http://libvirt.org"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=fb919cc88dbe06ec0b0bd50e001ccf1f"
 SECTION = "console/tools"
-PR = "r8"
+PR = "r9"
 
 DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \
-	   iptables ebtables dnsmasq readline"
+	   iptables dnsmasq readline"
 
 # These might be included by PACKAGECONFIG
 #RRECOMMENDS+= "polkit qemu yajl libnl lxc netcf"
@@ -113,7 +113,9 @@ INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72"
 
 # full config
 PACKAGECONFIG ??= "qemu yajl xen libxl xen-inotify uml openvz vmware vbox esx \
-	           polkit lxc test remote macvtap libvirtd netcf udev python ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
+	           polkit lxc test remote macvtap libvirtd netcf udev python \
+	           ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
+	           ebtables"
 
 # enable,disable,depends,rdepends
 #
@@ -140,6 +142,8 @@ PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf"
 PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,,"
 PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess,"
 PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
+PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables"
+
 # Enable the Python tool support
 require libvirt-python.inc
 
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] libvirt: fix libvirtd crash if path part of URI is missing
  2013-06-28 17:26 [PATCH 1/3] libvirt: fix libvirtd crash if path part of URI is missing Mark Asselstine
  2013-06-28 17:26 ` [PATCH 2/3] libvirt: use 4 fields for PACKAGECONFIG[] Mark Asselstine
@ 2013-06-28 18:10 ` Bruce Ashfield
  1 sibling, 0 replies; 4+ messages in thread
From: Bruce Ashfield @ 2013-06-28 18:10 UTC (permalink / raw)
  To: Mark Asselstine; +Cc: meta-virtualization

Merged these three and the dangling single patch!

Bruce

On Fri, Jun 28, 2013 at 1:26 PM, Mark Asselstine
<mark.asselstine@windriver.com> wrote:
> From: thomas tai <ttai@ala-lpd-test3.wrs.com>
>
> If the user forgets to include the path portion of the URI, instead of
> receiving an error message, libvirtd crashes.
>
> So for example attempting to make this call will cause libvirtd to
> fall over.
>
> virsh -c qemu+ssh://root@my.host.com list
> (forgetting the trailing /system after the host name)
>
> The reason for the crash is that libvirtd is trying to output an error
> message with a uninitialized variable. This problem is already fixed
> in the upstream so applying this fix to our tree allows this issue to
> be avoided.
>
> Signed-off-by: Thomas Tai <thomas.tai@windriver.com>
> Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
> ---
>  .../libvirt/qemu-fix-crash-in-qemuOpen.patch       | 39 ++++++++++++++++++++++
>  recipes-extended/libvirt/libvirt_1.0.3.bb          |  5 +--
>  2 files changed, 42 insertions(+), 2 deletions(-)
>  create mode 100644 recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch
>
> diff --git a/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch
> new file mode 100644
> index 0000000..3cf9e83
> --- /dev/null
> +++ b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch
> @@ -0,0 +1,39 @@
> +From 74bff2509080912ea8abf1de8fd95fa2412b659a Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
> +Date: Thu, 11 Apr 2013 11:37:25 +0200
> +Subject: [PATCH] qemu: fix crash in qemuOpen
> +
> +commit 74bff2509080912ea8abf1de8fd95fa2412b659a from upsteam
> +git://libvirt.org/libvirt.git
> +
> +If the path part of connection URI is not present, cfg is used
> +unitialized.
> +
> +https://bugzilla.redhat.com/show_bug.cgi?id=950855
> +---
> + src/qemu/qemu_driver.c |    2 +-
> + 1 files changed, 1 insertions(+), 1 deletions(-)
> +
> +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> +index 2c0d7d1..0d41e39 100644
> +--- a/src/qemu/qemu_driver.c
> ++++ b/src/qemu/qemu_driver.c
> +@@ -1026,6 +1026,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
> +             goto cleanup;
> +         }
> +
> ++        cfg = virQEMUDriverGetConfig(qemu_driver);
> +         if (conn->uri->path == NULL) {
> +             virReportError(VIR_ERR_INTERNAL_ERROR,
> +                            _("no QEMU URI path given, try %s"),
> +@@ -1033,7 +1034,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
> +             goto cleanup;
> +         }
> +
> +-        cfg = virQEMUDriverGetConfig(qemu_driver);
> +         if (cfg->privileged) {
> +             if (STRNEQ(conn->uri->path, "/system") &&
> +                 STRNEQ(conn->uri->path, "/session")) {
> +--
> +1.7.1
> +
> diff --git a/recipes-extended/libvirt/libvirt_1.0.3.bb b/recipes-extended/libvirt/libvirt_1.0.3.bb
> index 768ccc8..845baf5 100644
> --- a/recipes-extended/libvirt/libvirt_1.0.3.bb
> +++ b/recipes-extended/libvirt/libvirt_1.0.3.bb
> @@ -3,7 +3,7 @@ HOMEPAGE = "http://libvirt.org"
>  LICENSE = "GPLv2+"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=fb919cc88dbe06ec0b0bd50e001ccf1f"
>  SECTION = "console/tools"
> -PR = "r6"
> +PR = "r7"
>
>  DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \
>            iptables ebtables dnsmasq readline"
> @@ -25,7 +25,8 @@ RCONFLICTS_${PN}_libvirtd = "connman"
>  SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz \
>    file://libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch \
>         file://libvirtd.sh \
> -       file://libvirtd.conf"
> +       file://libvirtd.conf \
> +       file://qemu-fix-crash-in-qemuOpen.patch "
>
>  SRC_URI[md5sum] = "3d9f85d586c9aa3d819b626622f3fc97"
>  SRC_URI[sha256sum] = "f64f4acd7cdcfc6ab5e803195ed58b949f262b54e3659d8c37b33f0fec112757"
> --
> 1.8.1.2
>
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-28 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 17:26 [PATCH 1/3] libvirt: fix libvirtd crash if path part of URI is missing Mark Asselstine
2013-06-28 17:26 ` [PATCH 2/3] libvirt: use 4 fields for PACKAGECONFIG[] Mark Asselstine
2013-06-28 17:26   ` [PATCH 3/3] libvirt: make ebtables a PACKAGECONFIG Mark Asselstine
2013-06-28 18:10 ` [PATCH 1/3] libvirt: fix libvirtd crash if path part of URI is missing Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.