File CVE-2019-10166-api-disallow-virDomainManagedSaveDefineXML.patch of Package libvirt.11700

From 6c937eeb65e2cc605bda7060a5bd0ba24c80cbb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Fri, 14 Jun 2019 10:37:32 +0200
Subject: [PATCH 2/4] api: disallow virDomainManagedSaveDefineXML on read-only
 connections
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The virDomainManagedSaveDefineXML can be used to alter the domain's
config used for managedsave or even execute arbitrary emulator binaries.
Forbid it on read-only connections.

Fixes: CVE-2019-10166
Reported-by: Matthias Gerstner <mgerstner@suse.de>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/libvirt-domain.c | 1 +
 1 file changed, 1 insertion(+)

Index: libvirt-5.1.0/src/libvirt-domain.c
===================================================================
--- libvirt-5.1.0.orig/src/libvirt-domain.c
+++ libvirt-5.1.0/src/libvirt-domain.c
@@ -9565,6 +9565,7 @@ virDomainManagedSaveDefineXML(virDomainP
 
     virCheckDomainReturn(domain, -1);
     conn = domain->conn;
+    virCheckReadOnlyGoto(conn->flags, error);
 
     if (conn->driver->domainManagedSaveDefineXML) {
         int ret;
openSUSE Build Service is sponsored by