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

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