render / rpms / libvirt

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