Blame SOURCES/libvirt-rpc-require-write-acl-for-guest-agent-in-virDomainInterfaceAddresses.patch

2ba5aa
From 48f74599ffc86aa632ee39aff1aa8459880ec283 Mon Sep 17 00:00:00 2001
2ba5aa
Message-Id: <48f74599ffc86aa632ee39aff1aa8459880ec283@dist-git>
2ba5aa
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
2ba5aa
Date: Tue, 29 Sep 2020 14:43:05 +0200
2ba5aa
Subject: [PATCH] rpc: require write acl for guest agent in
2ba5aa
 virDomainInterfaceAddresses
2ba5aa
MIME-Version: 1.0
2ba5aa
Content-Type: text/plain; charset=UTF-8
2ba5aa
Content-Transfer-Encoding: 8bit
2ba5aa
2ba5aa
CVE-2020-25637
2ba5aa
2ba5aa
Add a requirement for domain:write if source is set to
2ba5aa
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT.
2ba5aa
2ba5aa
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2ba5aa
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
2ba5aa
(cherry picked from commit e4116eaa44cb366b59f7fe98f4b88d04c04970ad)
2ba5aa
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2ba5aa
2ba5aa
Conflicts: src/lxc/lxc_driver.c
2ba5aa
    The LXC implementation of the API was introduced
2ba5aa
    in libvirt 6.1.0, so it's not present downstream.
2ba5aa
Message-Id: <5fdc2ebf7621698c8136b354922c687fc09286de.1601383236.git.jtomko@redhat.com>
2ba5aa
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2ba5aa
---
2ba5aa
 src/libxl/libxl_driver.c     | 2 +-
2ba5aa
 src/qemu/qemu_driver.c       | 2 +-
2ba5aa
 src/remote/remote_protocol.x | 1 +
2ba5aa
 3 files changed, 3 insertions(+), 2 deletions(-)
2ba5aa
2ba5aa
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
2ba5aa
index f021ec9c5d..1449795494 100644
2ba5aa
--- a/src/libxl/libxl_driver.c
2ba5aa
+++ b/src/libxl/libxl_driver.c
2ba5aa
@@ -6318,7 +6318,7 @@ libxlDomainInterfaceAddresses(virDomainPtr dom,
2ba5aa
     if (!(vm = libxlDomObjFromDomain(dom)))
2ba5aa
         goto cleanup;
2ba5aa
 
2ba5aa
-    if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def) < 0)
2ba5aa
+    if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def, source) < 0)
2ba5aa
         goto cleanup;
2ba5aa
 
2ba5aa
     if (virDomainObjCheckActive(vm) < 0)
2ba5aa
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
2ba5aa
index f8a259e020..0f06974a1b 100644
2ba5aa
--- a/src/qemu/qemu_driver.c
2ba5aa
+++ b/src/qemu/qemu_driver.c
2ba5aa
@@ -22240,7 +22240,7 @@ qemuDomainInterfaceAddresses(virDomainPtr dom,
2ba5aa
     if (!(vm = qemuDomainObjFromDomain(dom)))
2ba5aa
         goto cleanup;
2ba5aa
 
2ba5aa
-    if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def) < 0)
2ba5aa
+    if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def, source) < 0)
2ba5aa
         goto cleanup;
2ba5aa
 
2ba5aa
     if (virDomainObjCheckActive(vm) < 0)
2ba5aa
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
2ba5aa
index 2527a78142..fbd30085b2 100644
2ba5aa
--- a/src/remote/remote_protocol.x
2ba5aa
+++ b/src/remote/remote_protocol.x
2ba5aa
@@ -6211,6 +6211,7 @@ enum remote_procedure {
2ba5aa
     /**
2ba5aa
      * @generate: none
2ba5aa
      * @acl: domain:read
2ba5aa
+     * @acl: domain:write::source:VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT
2ba5aa
      */
2ba5aa
     REMOTE_PROC_DOMAIN_INTERFACE_ADDRESSES = 353,
2ba5aa
 
2ba5aa
-- 
2ba5aa
2.28.0
2ba5aa