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

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



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 sigxcpu org>
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


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