Re: [libvirt] [PATCH] dont't crash in virsh dominfo <domain>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 18, 2010 at 02:48:46PM +0100, Daniel Veillard wrote:
> On Wed, Mar 17, 2010 at 09:11:07PM +0100, Guido Günther wrote:
> > Hi,
> > 
> > virsh dominfo domain crashes with:
> > 
> > #0  strlen () at ../sysdeps/i386/i486/strlen.S:69
> > #1  0x080891c9 in qemudNodeGetSecurityModel (conn=0x8133940, secmodel=0xb5676ede) at qemu/qemu_driver.c:4911
> > #2  0xb7eb5623 in virNodeGetSecurityModel (conn=0x8133940, secmodel=0x0) at libvirt.c:5118
> > #3  0x0806767a in remoteDispatchNodeGetSecurityModel (server=0x8118888, client=0x8134080, conn=0x8133940, hdr=0x81a8388, rerr=0xb56771d8, args=0xb56771a0, ret=0xb5677144) at remote.c:1306
> > #4  0x08068acc in remoteDispatchClientCall (server=0x8118888, client=0x8134080, msg=0x8168378) at dispatch.c:506
> > #5  0x08068ee3 in remoteDispatchClientRequest (server=0x8118888, client=0x8134080, msg=0x8168378) at dispatch.c:388
> > #6  0x0805baba in qemudWorker (data=0x811de2c) at libvirtd.c:1528
> > #7  0xb7bb8585 in start_thread (arg=0xb5677b70) at pthread_create.c:300
> > #8  0xb7b3a29e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
> > 
> > if there's no primary security driver set since we only intialize the
> > secmodel.model and secmodel.doi if we have one. Attached patch checks
> > for primarySecurityDriver instead of securityDriver since the later is
> > always set in qemudSecurityInit().
> > Cheers,
> >  -- Guido
> 
> > >From 1d26ec760739b0ea17d1b29730dbdb5632d3565c Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@xxxxxxxxxxx>
> > Date: Wed, 17 Mar 2010 21:04:11 +0100
> > Subject: [PATCH] Don't crash without a security driver
> > 
> > "virsh dominfo <vm>" crashes if there's no primary security driver set
> > since we only intialize the secmodel.model and secmodel.doi if we have
> > one. Attached patch checks for securityPrimaryDriver instead of
> > securityDriver since the later is always set in qemudSecurityInit().
> > 
> > Closes: http://bugs.debian.org/574359
> > ---
> >  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 67d9ade..e26c591 100644
> > --- a/src/qemu/qemu_driver.c
> > +++ b/src/qemu/qemu_driver.c
> > @@ -4956,7 +4956,7 @@ static int qemudNodeGetSecurityModel(virConnectPtr conn,
> >      int ret = 0;
> >  
> >      qemuDriverLock(driver);
> > -    if (!driver->securityDriver) {
> > +    if (!driver->securityPrimaryDriver) {
> >          memset(secmodel, 0, sizeof (*secmodel));
> >          goto cleanup;
> >      }
> > -- 
> > 1.7.0
> 
>   That looks fine to me, but I would prefer if Dan can double check :-)
Dan agreed and I pushed the change.
 -- Guido

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]