From aeaac79c1b9cf7f4696b056e05ff74350ed6016a62780142e9ed3c81f8a24413 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Thu, 21 Jun 2012 05:41:40 +0000 Subject: [PATCH] - Fix segfault in libvirt_lxc 57349ffc-lxc-ctrl.patch bnc#767448 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=214 --- 57349ffc-lxc-ctrl.patch | 70 +++++++++++++++++++++++++++++++++++++++++ libvirt.changes | 7 +++++ libvirt.spec | 2 ++ 3 files changed, 79 insertions(+) create mode 100644 57349ffc-lxc-ctrl.patch diff --git a/57349ffc-lxc-ctrl.patch b/57349ffc-lxc-ctrl.patch new file mode 100644 index 0000000..2f5f13a --- /dev/null +++ b/57349ffc-lxc-ctrl.patch @@ -0,0 +1,70 @@ +commit 57349ffc10290eed2cb25ca7cfb4b34ab5003156 +Author: Jim Fehlig +Date: Wed Jun 20 23:28:09 2012 -0600 + + Initialize random generator in lxc controller + + The lxc contoller eventually makes use of virRandomBits(), which was + segfaulting since virRandomInitialize() is never invoked. + + Program received signal SIGSEGV, Segmentation fault. + 0x00007ffff554d560 in random_r () from /lib64/libc.so.6 + (gdb) bt + 0 0x00007ffff554d560 in random_r () from /lib64/libc.so.6 + 1 0x0000000000469eaa in virRandomBits (nbits=32) at util/virrandom.c:80 + 2 0x000000000045bf69 in virHashCreateFull (size=256, + dataFree=0x4aa2a2 , keyCode=0x45bd40 , + keyEqual=0x45bdad , keyCopy=0x45bdfa , + keyFree=0x45be37 ) at util/virhash.c:134 + 3 0x000000000045c069 in virHashCreate (size=0, dataFree=0x4aa2a2 ) + at util/virhash.c:164 + 4 0x00000000004aa562 in virNWFilterHashTableCreate (n=0) + at conf/nwfilter_params.c:686 + 5 0x00000000004aa95b in virNWFilterParseParamAttributes (cur=0x711d30) + at conf/nwfilter_params.c:793 + 6 0x0000000000481a7f in virDomainNetDefParseXML (caps=0x702c90, node=0x7116b0, + ctxt=0x7101b0, bootMap=0x0, flags=0) at conf/domain_conf.c:4589 + 7 0x000000000048cc36 in virDomainDefParseXML (caps=0x702c90, xml=0x710040, + root=0x7103b0, ctxt=0x7101b0, expectedVirtTypes=16, flags=0) + at conf/domain_conf.c:8658 + 8 0x000000000048f011 in virDomainDefParseNode (caps=0x702c90, xml=0x710040, + root=0x7103b0, expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9360 + 9 0x000000000048ee30 in virDomainDefParse (xmlStr=0x0, + filename=0x702ae0 "/var/run/libvirt/lxc/x.xml", caps=0x702c90, + expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9310 + 10 0x000000000048ef00 in virDomainDefParseFile (caps=0x702c90, + filename=0x702ae0 "/var/run/libvirt/lxc/x.xml", expectedVirtTypes=16, flags=0) + at conf/domain_conf.c:9332 + 11 0x0000000000425053 in main (argc=5, argv=0x7fffffffe2b8) + at lxc/lxc_controller.c:1773 + +Index: libvirt-0.9.11.4/src/lxc/lxc_controller.c +=================================================================== +--- libvirt-0.9.11.4.orig/src/lxc/lxc_controller.c ++++ libvirt-0.9.11.4/src/lxc/lxc_controller.c +@@ -43,6 +43,7 @@ + #include + #include + #include ++#include + + #if HAVE_CAPNG + # include +@@ -71,6 +72,7 @@ + #include "command.h" + #include "processinfo.h" + #include "nodeinfo.h" ++#include "virrandom.h" + + #define VIR_FROM_THIS VIR_FROM_LXC + +@@ -1663,7 +1665,8 @@ int main(int argc, char *argv[]) + + if (setlocale(LC_ALL, "") == NULL || + bindtextdomain(PACKAGE, LOCALEDIR) == NULL || +- textdomain(PACKAGE) == NULL) { ++ textdomain(PACKAGE) == NULL || ++ virRandomInitialize(time(NULL) ^ getpid())) { + fprintf(stderr, _("%s: initialization failed\n"), argv[0]); + exit(EXIT_FAILURE); + } diff --git a/libvirt.changes b/libvirt.changes index b48b211..3e474af 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jun 20 23:40:14 MDT 2012 - jfehlig@suse.com + +- Fix segfault in libvirt_lxc + 57349ffc-lxc-ctrl.patch + bnc#767448 + ------------------------------------------------------------------- Wed Jun 20 10:48:35 MDT 2012 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index c52f73c..017a1ac 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -412,6 +412,7 @@ Source99: baselibs.conf # Upstream patches # Revert v0.9.11-maint branch commit d8978c90 Patch0: revert-d8978c90.patch +Patch1: 57349ffc-lxc-ctrl.patch # Need to go upstream Patch100: xen-name-for-devid.patch Patch101: clone.patch @@ -548,6 +549,7 @@ Authors: %prep %setup -q %patch0 -p1 +%patch1 -p1 %patch100 -p1 %patch101 %patch102 -p1