summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHitendra Prajapati <hprajapati@mvista.com>2022-06-29 11:08:55 +0530
committerBruce Ashfield <bruce.ashfield@gmail.com>2022-07-05 16:28:15 -0400
commita63a54df3170fed387f810f23cdc2f483ad587df (patch)
tree62a31560e43664826af722002d448cbbee9138de
parentab3bbe30b60c51b8df4b568c253d559328c8750f (diff)
downloadmeta-virtualization-a63a54df3170fed387f810f23cdc2f483ad587df.tar.gz
libvirt: CVE-2022-0897 missing locking in nwfilterConnectNumOfNWFilters can lead to denial of service
Source: https://gitlab.com/libvirt/libvirt MR: 116994 Type: Security Fix Disposition: Backport from https://gitlab.com/libvirt/libvirt/-/commit/a4947e8f63c3e6b7b067b444f3d6cf674c0d7f36 ChangeID: 628f3cc089ee965dda670aa8f9ab169cec5cb63a Description: CVE-2022-0897 libvirt: missing locking in nwfilterConnectNumOfNWFilters can lead to denial of service. Affects "libvirt < 6.1" Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-extended/libvirt/libvirt/CVE-2022-0897.patch57
-rw-r--r--recipes-extended/libvirt/libvirt_6.1.0.bb1
2 files changed, 58 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt/CVE-2022-0897.patch b/recipes-extended/libvirt/libvirt/CVE-2022-0897.patch
new file mode 100644
index 00000000..81e3194c
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt/CVE-2022-0897.patch
@@ -0,0 +1,57 @@
1From 949548615761737bccc0046ae30b1b7cdf50ec39 Mon Sep 17 00:00:00 2001
2From: Hitendra Prajapati <hprajapati@mvista.com>
3Date: Mon, 27 Jun 2022 11:13:53 +0530
4Subject: [PATCH] CVE-2022-0897
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream-Status: Backport [https://gitlab.com/libvirt/libvirt/-/commit/a4947e8f63c3e6b7b067b444f3d6cf674c0d7f36]
10CVE: CVE-2022-0897
11Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
12
13nwfilter: fix crash when counting number of network filters
14
15The virNWFilterObjListNumOfNWFilters method iterates over the
16driver->nwfilters, accessing virNWFilterObj instances. As such
17it needs to be protected against concurrent modification of
18the driver->nwfilters object.
19
20This API allows unprivileged users to connect, so users with
21read-only access to libvirt can cause a denial of service
22crash if they are able to race with a call of virNWFilterUndefine.
23Since network filters are usually statically defined, this is
24considered a low severity problem.
25
26This is assigned CVE-2022-0897.
27Reviewed-by: Eric Blake's avatarEric Blake <eblake@redhat.com>
28Signed-off-by: Daniel P. Berrangé's avatarDaniel P. Berrangé <berrange@redhat.com>
29---
30 src/nwfilter/nwfilter_driver.c | 8 ++++++--
31 1 file changed, 6 insertions(+), 2 deletions(-)
32
33diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
34index 1c40772..27500d1 100644
35--- a/src/nwfilter/nwfilter_driver.c
36+++ b/src/nwfilter/nwfilter_driver.c
37@@ -514,11 +514,15 @@ nwfilterLookupByName(virConnectPtr conn,
38 static int
39 nwfilterConnectNumOfNWFilters(virConnectPtr conn)
40 {
41+ int ret;
42 if (virConnectNumOfNWFiltersEnsureACL(conn) < 0)
43 return -1;
44
45- return virNWFilterObjListNumOfNWFilters(driver->nwfilters, conn,
46- virConnectNumOfNWFiltersCheckACL);
47+ nwfilterDriverLock();
48+ ret = virNWFilterObjListNumOfNWFilters(driver->nwfilters, conn,
49+ virConnectNumOfNWFiltersCheckACL);
50+ nwfilterDriverUnlock();
51+ return ret;
52 }
53
54
55--
562.25.1
57
diff --git a/recipes-extended/libvirt/libvirt_6.1.0.bb b/recipes-extended/libvirt/libvirt_6.1.0.bb
index d0f2c315..97c1019c 100644
--- a/recipes-extended/libvirt/libvirt_6.1.0.bb
+++ b/recipes-extended/libvirt/libvirt_6.1.0.bb
@@ -47,6 +47,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \
47 file://CVE-2020-25637_4.patch \ 47 file://CVE-2020-25637_4.patch \
48 file://CVE-2021-3631.patch \ 48 file://CVE-2021-3631.patch \
49 file://CVE-2021-3667.patch \ 49 file://CVE-2021-3667.patch \
50 file://CVE-2022-0897.patch \
50 " 51 "
51SRC_URI[libvirt.md5sum] = "a870e63f20fac2ccf98e716d05256145" 52SRC_URI[libvirt.md5sum] = "a870e63f20fac2ccf98e716d05256145"
52SRC_URI[libvirt.sha256sum] = "167c185be45560e73dd3e14ed375778b555c01455192de2dafc4d0f74fabebc0" 53SRC_URI[libvirt.sha256sum] = "167c185be45560e73dd3e14ed375778b555c01455192de2dafc4d0f74fabebc0"