diff options
| author | Xu, Yanfei <yanfei.xu@windriver.com> | 2021-11-24 10:51:33 +0800 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-11-24 16:59:58 -0500 |
| commit | be2c9d6efe545ec6718902be9c56a698662ff055 (patch) | |
| tree | b28d9d1dde049fbbebfe311b4bf88441b04889f1 | |
| parent | 3d8ac6655c6e1b298969a10a2679f20cab1013e9 (diff) | |
| download | meta-virtualization-be2c9d6efe545ec6718902be9c56a698662ff055.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>
| -rw-r--r-- | recipes-extended/libvirt/libvirt/0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch | 40 | ||||
| -rw-r--r-- | recipes-extended/libvirt/libvirt_6.3.0.bb | 1 |
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 @@ | |||
| 1 | From d3e20e186ed531e196bb1529430f39b0c917e6dc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Peter Krempa <pkrempa@redhat.com> | ||
| 3 | Date: Wed, 21 Jul 2021 11:22:25 +0200 | ||
| 4 | Subject: [PATCH] storage_driver: Unlock object on ACL fail in | ||
| 5 | storagePoolLookupByTargetPath | ||
| 6 | |||
| 7 | 'virStoragePoolObjListSearch' returns a locked and refed object, thus we | ||
| 8 | must release it on ACL permission failure. | ||
| 9 | |||
| 10 | Fixes: 7aa0e8c0cb8 | ||
| 11 | Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984318 | ||
| 12 | Signed-off-by: Peter Krempa <pkrempa@redhat.com> | ||
| 13 | Reviewed-by: Michal Privoznik <mprivozn@redhat.com> | ||
| 14 | |||
| 15 | Upstream-status: Backport | ||
| 16 | CVE-2021-3667 [https://bugzilla.redhat.com/show_bug.cgi?id=1986094] | ||
| 17 | Signed-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 | |||
| 22 | diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c | ||
| 23 | index 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 | -- | ||
| 39 | 2.27.0 | ||
| 40 | |||
diff --git a/recipes-extended/libvirt/libvirt_6.3.0.bb b/recipes-extended/libvirt/libvirt_6.3.0.bb index 33bac767..091296ef 100644 --- a/recipes-extended/libvirt/libvirt_6.3.0.bb +++ b/recipes-extended/libvirt/libvirt_6.3.0.bb | |||
| @@ -45,6 +45,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \ | |||
| 45 | file://CVE-2020-25637_3.patch \ | 45 | file://CVE-2020-25637_3.patch \ |
| 46 | file://CVE-2020-25637_4.patch \ | 46 | file://CVE-2020-25637_4.patch \ |
| 47 | file://CVE-2021-3631.patch \ | 47 | file://CVE-2021-3631.patch \ |
| 48 | file://0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch \ | ||
| 48 | " | 49 | " |
| 49 | 50 | ||
| 50 | SRC_URI[libvirt.md5sum] = "1bd4435f77924f5ec9928b538daf4a02" | 51 | SRC_URI[libvirt.md5sum] = "1bd4435f77924f5ec9928b538daf4a02" |
