render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
e870a1
From 9c54ef7c05dce6b67d6f7ff8ba8b414612bbaed1 Mon Sep 17 00:00:00 2001
e870a1
Message-Id: <9c54ef7c05dce6b67d6f7ff8ba8b414612bbaed1@dist-git>
e870a1
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
e870a1
Date: Wed, 30 Sep 2020 17:38:14 +0200
e870a1
Subject: [PATCH] rpc: require write acl for guest agent in
e870a1
 virDomainInterfaceAddresses
e870a1
MIME-Version: 1.0
e870a1
Content-Type: text/plain; charset=UTF-8
e870a1
Content-Transfer-Encoding: 8bit
e870a1
e870a1
CVE-2020-25637
e870a1
e870a1
Add a requirement for domain:write if source is set to
e870a1
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT.
e870a1
e870a1
Signed-off-by: Ján Tomko <jtomko@redhat.com>
e870a1
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
e870a1
(cherry picked from commit e4116eaa44cb366b59f7fe98f4b88d04c04970ad)
e870a1
Signed-off-by: Ján Tomko <jtomko@redhat.com>
e870a1
e870a1
Conflicts: src/lxc/lxc_driver.c
e870a1
    The LXC implementation of the API was introduced
e870a1
    in libvirt 6.1.0, so it's not present downstream.
e870a1
  src/qemu/qemu_driver.c
e870a1
    Commit 5910b180 is not present downstream.
e870a1
Message-Id: <7db63b4388d8b1fd096892e1465abcff99c6696a.1601480224.git.jtomko@redhat.com>
e870a1
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
e870a1
---
e870a1
 src/libxl/libxl_driver.c     | 2 +-
e870a1
 src/qemu/qemu_driver.c       | 2 +-
e870a1
 src/remote/remote_protocol.x | 1 +
e870a1
 3 files changed, 3 insertions(+), 2 deletions(-)
e870a1
e870a1
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
e870a1
index 1eb63c5b64..d157a78bef 100644
e870a1
--- a/src/libxl/libxl_driver.c
e870a1
+++ b/src/libxl/libxl_driver.c
e870a1
@@ -6199,7 +6199,7 @@ libxlDomainInterfaceAddresses(virDomainPtr dom,
e870a1
     if (!(vm = libxlDomObjFromDomain(dom)))
e870a1
         goto cleanup;
e870a1
 
e870a1
-    if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def) < 0)
e870a1
+    if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def, source) < 0)
e870a1
         goto cleanup;
e870a1
 
e870a1
     if (virDomainObjCheckActive(vm) < 0)
e870a1
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
e870a1
index 449d869f98..223583b5a7 100644
e870a1
--- a/src/qemu/qemu_driver.c
e870a1
+++ b/src/qemu/qemu_driver.c
e870a1
@@ -20687,7 +20687,7 @@ qemuDomainInterfaceAddresses(virDomainPtr dom,
e870a1
     if (!(vm = qemuDomObjFromDomain(dom)))
e870a1
         goto cleanup;
e870a1
 
e870a1
-    if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def) < 0)
e870a1
+    if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def, source) < 0)
e870a1
         goto cleanup;
e870a1
 
e870a1
     if (virDomainObjCheckActive(vm) < 0)
e870a1
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
e870a1
index c370755f68..78208e5855 100644
e870a1
--- a/src/remote/remote_protocol.x
e870a1
+++ b/src/remote/remote_protocol.x
e870a1
@@ -5997,6 +5997,7 @@ enum remote_procedure {
e870a1
     /**
e870a1
      * @generate: none
e870a1
      * @acl: domain:read
e870a1
+     * @acl: domain:write::source:VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT
e870a1
      */
e870a1
     REMOTE_PROC_DOMAIN_INTERFACE_ADDRESSES = 353,
e870a1
 
e870a1
-- 
e870a1
2.28.0
e870a1