render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 4843e53175b76c8a3676756db314354a696e2785 Mon Sep 17 00:00:00 2001
Message-Id: <4843e53175b76c8a3676756db314354a696e2785@dist-git>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Tue, 23 Sep 2014 15:43:37 +0200
Subject: [PATCH] domain_conf: fix domain deadlock

CVE-2014-3657

If you use public api virConnectListAllDomains() with second parameter
set to NULL to get only the number of domains you will lock out all
other operations with domains.

Introduced by commit 2c680804.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d1617b8..bb2e7ef 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -18748,7 +18748,7 @@ virDomainListPopulate(void *payload,
     /* just count the machines */
     if (!data->domains) {
         data->ndomains++;
-        return;
+        goto cleanup;
     }
 
     if (!(dom = virGetDomain(data->conn, vm->def->name, vm->def->uuid))) {
-- 
2.1.0