fix CVE-2022-0897 (openeuler !66)
nwfilter: fix crash when counting number of network filters (CVE-2022-0897) Signed-off-by: yezengruan <yezengruan@huawei.com>
This commit is contained in:
parent
8ffe16e78d
commit
78c20fb7ab
@ -101,7 +101,7 @@
|
|||||||
Summary: Library providing a simple virtualization API
|
Summary: Library providing a simple virtualization API
|
||||||
Name: libvirt
|
Name: libvirt
|
||||||
Version: 6.2.0
|
Version: 6.2.0
|
||||||
Release: 18
|
Release: 19
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: https://libvirt.org/
|
URL: https://libvirt.org/
|
||||||
|
|
||||||
@ -153,6 +153,7 @@ Patch0040: virDevMapperGetTargets-Don-t-ignore-EBADF.patch
|
|||||||
Patch0041: virdevmapper-Don-t-cache-device-mapper-major.patch
|
Patch0041: virdevmapper-Don-t-cache-device-mapper-major.patch
|
||||||
Patch0042: virdevmapper-Handle-kernel-without-device-mapper-sup.patch
|
Patch0042: virdevmapper-Handle-kernel-without-device-mapper-sup.patch
|
||||||
Patch0043: virsh-Display-vhostuser-socket-path-in-domblklist.patch
|
Patch0043: virsh-Display-vhostuser-socket-path-in-domblklist.patch
|
||||||
|
Patch0044: nwfilter-fix-crash-when-counting-number-of-network-f.patch
|
||||||
|
|
||||||
Requires: libvirt-daemon = %{version}-%{release}
|
Requires: libvirt-daemon = %{version}-%{release}
|
||||||
Requires: libvirt-daemon-config-network = %{version}-%{release}
|
Requires: libvirt-daemon-config-network = %{version}-%{release}
|
||||||
@ -1887,6 +1888,9 @@ exit 0
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jun 20 2022 yezengruan <yezengruan@huawei.com>
|
||||||
|
- nwfilter: fix crash when counting number of network filters (CVE-2022-0897)
|
||||||
|
|
||||||
* Wed Jun 15 2022 yezengruan <yezengruan@huawei.com>
|
* Wed Jun 15 2022 yezengruan <yezengruan@huawei.com>
|
||||||
- libvir.spec: build without dtrace
|
- libvir.spec: build without dtrace
|
||||||
|
|
||||||
|
|||||||
54
nwfilter-fix-crash-when-counting-number-of-network-f.patch
Normal file
54
nwfilter-fix-crash-when-counting-number-of-network-f.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
From 68a8d65095a144e9ce77e3ea2121155485fe195d Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlexChen <alex.chen@huawei.com>
|
||||||
|
Date: Tue, 8 Mar 2022 17:28:38 +0000
|
||||||
|
Subject: [PATCH] nwfilter: fix crash when counting number of network filters
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
The virNWFilterObjListNumOfNWFilters method iterates over the
|
||||||
|
driver->nwfilters, accessing virNWFilterObj instances. As such
|
||||||
|
it needs to be protected against concurrent modification of
|
||||||
|
the driver->nwfilters object.
|
||||||
|
|
||||||
|
This API allows unprivileged users to connect, so users with
|
||||||
|
read-only access to libvirt can cause a denial of service
|
||||||
|
crash if they are able to race with a call of virNWFilterUndefine.
|
||||||
|
Since network filters are usually statically defined, this is
|
||||||
|
considered a low severity problem.
|
||||||
|
|
||||||
|
This is assigned CVE-2022-0897.
|
||||||
|
|
||||||
|
Reviewed-by: Eric Blake <eblake@redhat.com>
|
||||||
|
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||||
|
cherry-picked from a4947e8f63c3e6
|
||||||
|
Signed-off-by: AlexChen <alex.chen@huawei.com>
|
||||||
|
---
|
||||||
|
src/nwfilter/nwfilter_driver.c | 8 ++++++--
|
||||||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
|
||||||
|
index 1c407727db..27500d192a 100644
|
||||||
|
--- a/src/nwfilter/nwfilter_driver.c
|
||||||
|
+++ b/src/nwfilter/nwfilter_driver.c
|
||||||
|
@@ -514,11 +514,15 @@ nwfilterLookupByName(virConnectPtr conn,
|
||||||
|
static int
|
||||||
|
nwfilterConnectNumOfNWFilters(virConnectPtr conn)
|
||||||
|
{
|
||||||
|
+ int ret;
|
||||||
|
if (virConnectNumOfNWFiltersEnsureACL(conn) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
- return virNWFilterObjListNumOfNWFilters(driver->nwfilters, conn,
|
||||||
|
- virConnectNumOfNWFiltersCheckACL);
|
||||||
|
+ nwfilterDriverLock();
|
||||||
|
+ ret = virNWFilterObjListNumOfNWFilters(driver->nwfilters, conn,
|
||||||
|
+ virConnectNumOfNWFiltersCheckACL);
|
||||||
|
+ nwfilterDriverUnlock();
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user