render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
83e969
From 66884f16592038ec091d4bb2ab1d492062a71c74 Mon Sep 17 00:00:00 2001
83e969
Message-Id: <66884f16592038ec091d4bb2ab1d492062a71c74@dist-git>
83e969
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
83e969
Date: Tue, 18 Jun 2019 13:30:02 +0200
83e969
Subject: [PATCH] api: disallow virConnect*HypervisorCPU on read-only
83e969
 connections
83e969
MIME-Version: 1.0
83e969
Content-Type: text/plain; charset=UTF-8
83e969
Content-Transfer-Encoding: 8bit
83e969
83e969
These APIs can be used to execute arbitrary emulators.
83e969
Forbid them on read-only connections.
83e969
83e969
Fixes: CVE-2019-10168
83e969
Signed-off-by: Ján Tomko <jtomko@redhat.com>
83e969
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
83e969
Signed-off-by: Ján Tomko <jtomko@redhat.com>
83e969
Message-Id: <470651092e7d6a4ba5875cf8885fd3714d5ea189.1560857354.git.jtomko@redhat.com>
83e969
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
83e969
---
83e969
 src/libvirt-host.c | 2 ++
83e969
 1 file changed, 2 insertions(+)
83e969
83e969
diff --git a/src/libvirt-host.c b/src/libvirt-host.c
83e969
index e20d6ee250..2978825d22 100644
83e969
--- a/src/libvirt-host.c
83e969
+++ b/src/libvirt-host.c
83e969
@@ -1041,6 +1041,7 @@ virConnectCompareHypervisorCPU(virConnectPtr conn,
83e969
 
83e969
     virCheckConnectReturn(conn, VIR_CPU_COMPARE_ERROR);
83e969
     virCheckNonNullArgGoto(xmlCPU, error);
83e969
+    virCheckReadOnlyGoto(conn->flags, error);
83e969
 
83e969
     if (conn->driver->connectCompareHypervisorCPU) {
83e969
         int ret;
83e969
@@ -1234,6 +1235,7 @@ virConnectBaselineHypervisorCPU(virConnectPtr conn,
83e969
 
83e969
     virCheckConnectReturn(conn, NULL);
83e969
     virCheckNonNullArgGoto(xmlCPUs, error);
83e969
+    virCheckReadOnlyGoto(conn->flags, error);
83e969
 
83e969
     if (conn->driver->connectBaselineHypervisorCPU) {
83e969
         char *cpu;
83e969
-- 
83e969
2.22.0
83e969