Blame SOURCES/libvirt-api-disallow-virDomainManagedSaveDefineXML-on-read-only-connections.patch

99cbc7
From 20a2fc74e717ca21e1a183b4e210872eb0c56be9 Mon Sep 17 00:00:00 2001
99cbc7
Message-Id: <20a2fc74e717ca21e1a183b4e210872eb0c56be9@dist-git>
99cbc7
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
99cbc7
Date: Tue, 18 Jun 2019 13:30:00 +0200
99cbc7
Subject: [PATCH] api: disallow virDomainManagedSaveDefineXML on read-only
99cbc7
 connections
99cbc7
MIME-Version: 1.0
99cbc7
Content-Type: text/plain; charset=UTF-8
99cbc7
Content-Transfer-Encoding: 8bit
99cbc7
99cbc7
The virDomainManagedSaveDefineXML can be used to alter the domain's
99cbc7
config used for managedsave or even execute arbitrary emulator binaries.
99cbc7
Forbid it on read-only connections.
99cbc7
99cbc7
Fixes: CVE-2019-10166
99cbc7
Reported-by: Matthias Gerstner <mgerstner@suse.de>
99cbc7
Signed-off-by: Ján Tomko <jtomko@redhat.com>
99cbc7
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
99cbc7
Signed-off-by: Ján Tomko <jtomko@redhat.com>
99cbc7
Message-Id: <352bf5e963a6482d426f97b0ef36ca019e69280b.1560857354.git.jtomko@redhat.com>
99cbc7
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
99cbc7
---
99cbc7
 src/libvirt-domain.c | 1 +
99cbc7
 1 file changed, 1 insertion(+)
99cbc7
99cbc7
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
99cbc7
index 697326ae9a..b936dd8eb7 100644
99cbc7
--- a/src/libvirt-domain.c
99cbc7
+++ b/src/libvirt-domain.c
99cbc7
@@ -9495,6 +9495,7 @@ virDomainManagedSaveDefineXML(virDomainPtr domain, const char *dxml,
99cbc7
 
99cbc7
     virCheckDomainReturn(domain, -1);
99cbc7
     conn = domain->conn;
99cbc7
+    virCheckReadOnlyGoto(conn->flags, error);
99cbc7
 
99cbc7
     if (conn->driver->domainManagedSaveDefineXML) {
99cbc7
         int ret;
99cbc7
-- 
99cbc7
2.22.0
99cbc7