summaryrefslogtreecommitdiffstats
path: root/recipes-extended/libvirt/libvirt/CVE-2023-3750.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/libvirt/libvirt/CVE-2023-3750.patch')
-rw-r--r--recipes-extended/libvirt/libvirt/CVE-2023-3750.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt/CVE-2023-3750.patch b/recipes-extended/libvirt/libvirt/CVE-2023-3750.patch
new file mode 100644
index 00000000..13ead87b
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt/CVE-2023-3750.patch
@@ -0,0 +1,59 @@
1From 3fe8b15323a4666564c519f32fd4ab072c472051 Mon Sep 17 00:00:00 2001
2From: Peter Krempa <pkrempa@redhat.com>
3Date: Thu, 13 Jul 2023 16:16:37 +0200
4Subject: [PATCH] storage: Fix returning of locked objects from
5 'virStoragePoolObjListSearch'
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10CVE-2023-3750
11
12'virStoragePoolObjListSearch' explicitly documents that it's returning
13a pointer to a locked and ref'd pool that maches the lookup function.
14
15This was not the case as in commit 0c4b391e2a9 (released in
16libvirt-8.3.0) the code was accidentally converted to use 'VIR_LOCK_GUARD'
17which auto-unlocked it when leaving the scope, even when the code was
18originally "leaking" the lock.
19
20Revert the corresponding conversion and add a comment that this function
21is intentionally leaking a locked object.
22
23Fixes: 0c4b391e2a9
24Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2221851
25Signed-off-by: Peter Krempa <pkrempa@redhat.com>
26Reviewed-by: Ján Tomko <jtomko@redhat.com>
27
28CVE: CVE-2023-3750
29Upstream-Status: Backport [https://gitlab.com/libvirt/libvirt/-/commit/9a47442366fcf8a7b6d7422016d7bbb6764a1098]
30Signed-off-by: Changqing Li <changqing.li@windriver.com>
31---
32 src/conf/virstorageobj.c | 7 ++++++-
33 1 file changed, 6 insertions(+), 1 deletion(-)
34
35diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
36index 7010e97..59fa5da 100644
37--- a/src/conf/virstorageobj.c
38+++ b/src/conf/virstorageobj.c
39@@ -454,11 +454,16 @@ virStoragePoolObjListSearchCb(const void *payload,
40 virStoragePoolObj *obj = (virStoragePoolObj *) payload;
41 struct _virStoragePoolObjListSearchData *data =
42 (struct _virStoragePoolObjListSearchData *)opaque;
43- VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
44
45+ virObjectLock(obj);
46+
47+ /* If we find the matching pool object we must return while the object is
48+ * locked as the caller wants to return a locked object. */
49 if (data->searcher(obj, data->opaque))
50 return 1;
51
52+ virObjectUnlock(obj);
53+
54 return 0;
55 }
56
57--
582.25.1
59