a2479f
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
a2479f
Date: Fri, 14 Jun 2019 09:14:53 +0200
a2479f
Subject: [PATCH] api: disallow virDomainManagedSaveDefineXML on read-only
a2479f
 connections
a2479f
MIME-Version: 1.0
a2479f
Content-Type: text/plain; charset=UTF-8
a2479f
Content-Transfer-Encoding: 8bit
a2479f
a2479f
The virDomainManagedSaveDefineXML can be used to alter the domain's
a2479f
config used for managedsave or even execute arbitrary emulator binaries.
a2479f
Forbid it on read-only connections.
a2479f
a2479f
Fixes: CVE-2019-10166
a2479f
Reported-by: Matthias Gerstner <mgerstner@suse.de>
a2479f
Signed-off-by: Ján Tomko <jtomko@redhat.com>
a2479f
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
a2479f
(cherry picked from commit db0b78457f183e4c7ac45bc94de86044a1e2056a)
a2479f
---
a2479f
 src/libvirt-domain.c | 1 +
a2479f
 1 file changed, 1 insertion(+)
a2479f
a2479f
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
a2479f
index 1cc8537c04..f77fc23a3f 100644
a2479f
--- a/src/libvirt-domain.c
a2479f
+++ b/src/libvirt-domain.c
a2479f
@@ -9563,6 +9563,7 @@ virDomainManagedSaveDefineXML(virDomainPtr domain, const char *dxml,
a2479f
 
a2479f
     virCheckDomainReturn(domain, -1);
a2479f
     conn = domain->conn;
a2479f
+    virCheckReadOnlyGoto(conn->flags, error);
a2479f
 
a2479f
     if (conn->driver->domainManagedSaveDefineXML) {
a2479f
         int ret;