summaryrefslogtreecommitdiffstats
path: root/recipes-extended
diff options
context:
space:
mode:
authorXu, Yanfei <yanfei.xu@windriver.com>2021-11-23 15:50:31 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2021-11-24 16:57:20 -0500
commitda0f1599ce3e001c809a2ddb9d0a1c75491dda94 (patch)
treeb09785bcecdee3b994238c3f9aa3ed1a52d143da /recipes-extended
parent9148b795f3b5a383c680ec6c3fae376d40d5265f (diff)
downloadmeta-virtualization-da0f1599ce3e001c809a2ddb9d0a1c75491dda94.tar.gz
libvirt: fix CVE-2021-3667
Backport a fix for CVE-2021-3667. The CVE discription: An improper locking issue was found in the virStoragePoolLookupByTargetPath API of libvirt. It occurs in the storagePoolLookupByTargetPath function where a locked virStoragePoolObj object is not properly released on ACL permission failure. Clients connecting to the read-write socket with limited ACL permissions could use this flaw to acquire the lock and prevent other users from accessing storage pool/volume APIs, resulting in a denial of service condition. The highest threat from this vulnerability is to system availability. Refer to: https://bugzilla.redhat.com/show_bug.cgi?id=1986094 Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended')
-rw-r--r--recipes-extended/libvirt/libvirt/0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch40
-rw-r--r--recipes-extended/libvirt/libvirt_7.2.0.bb1
2 files changed, 41 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt/0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch b/recipes-extended/libvirt/libvirt/0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch
new file mode 100644
index 00000000..608322d9
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt/0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch
@@ -0,0 +1,40 @@
1From d3e20e186ed531e196bb1529430f39b0c917e6dc Mon Sep 17 00:00:00 2001
2From: Peter Krempa <pkrempa@redhat.com>
3Date: Wed, 21 Jul 2021 11:22:25 +0200
4Subject: [PATCH] storage_driver: Unlock object on ACL fail in
5 storagePoolLookupByTargetPath
6
7'virStoragePoolObjListSearch' returns a locked and refed object, thus we
8must release it on ACL permission failure.
9
10Fixes: 7aa0e8c0cb8
11Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984318
12Signed-off-by: Peter Krempa <pkrempa@redhat.com>
13Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14
15Upstream-status: Backport
16CVE-2021-3667 [https://bugzilla.redhat.com/show_bug.cgi?id=1986094]
17Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
18---
19 src/storage/storage_driver.c | 4 +++-
20 1 file changed, 3 insertions(+), 1 deletion(-)
21
22diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
23index ecb5b86b4f..de66f1f9e5 100644
24--- a/src/storage/storage_driver.c
25+++ b/src/storage/storage_driver.c
26@@ -1739,8 +1739,10 @@ storagePoolLookupByTargetPath(virConnectPtr conn,
27 storagePoolLookupByTargetPathCallback,
28 cleanpath))) {
29 def = virStoragePoolObjGetDef(obj);
30- if (virStoragePoolLookupByTargetPathEnsureACL(conn, def) < 0)
31+ if (virStoragePoolLookupByTargetPathEnsureACL(conn, def) < 0) {
32+ virStoragePoolObjEndAPI(&obj);
33 return NULL;
34+ }
35
36 pool = virGetStoragePool(conn, def->name, def->uuid, NULL, NULL);
37 virStoragePoolObjEndAPI(&obj);
38--
392.27.0
40
diff --git a/recipes-extended/libvirt/libvirt_7.2.0.bb b/recipes-extended/libvirt/libvirt_7.2.0.bb
index cc7bb2cb..4ec11fb5 100644
--- a/recipes-extended/libvirt/libvirt_7.2.0.bb
+++ b/recipes-extended/libvirt/libvirt_7.2.0.bb
@@ -30,6 +30,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \
30 file://gnutls-helper.py \ 30 file://gnutls-helper.py \
31 file://0002-meson-Fix-compatibility-with-Meson-0.58.patch \ 31 file://0002-meson-Fix-compatibility-with-Meson-0.58.patch \
32 file://0001-security-fix-SELinux-label-generation-logic.patch \ 32 file://0001-security-fix-SELinux-label-generation-logic.patch \
33 file://0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch \
33 " 34 "
34 35
35SRC_URI[libvirt.md5sum] = "92044b629216e44adce63224970a54a3" 36SRC_URI[libvirt.md5sum] = "92044b629216e44adce63224970a54a3"