public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Matthias Maier" <tamiko@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/libvirt/, app-emulation/libvirt/files/
Date: Tue, 31 Oct 2023 16:25:24 +0000 (UTC)	[thread overview]
Message-ID: <1698769518.42fd27c7046a483b588a8e4e59f6ab8c1d2edcc2.tamiko@gentoo> (raw)

commit:     42fd27c7046a483b588a8e4e59f6ab8c1d2edcc2
Author:     Michal Privoznik <michal.privoznik <AT> gmail <DOT> com>
AuthorDate: Tue Oct 31 09:00:44 2023 +0000
Commit:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
CommitDate: Tue Oct 31 16:25:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42fd27c7

app-emulation/libvirt: Backport fix for CVE-2023-3750

A security flaw was identified in <app-emulation/libvirt-9.6.0
which can result int DoS. The upstream is fixed from 9.6.0.
Backport the fix to older versions found in portage.

Bug: https://bugs.gentoo.org/916497
Closes: https://github.com/gentoo/gentoo/pull/33604
Signed-off-by: Michal Privoznik <michal.privoznik <AT> gmail.com>
Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>

 ...-returning-of-locked-objects-from-virStor.patch | 57 ++++++++++++++++++++++
 ...ibvirt-9.3.0.ebuild => libvirt-9.3.0-r1.ebuild} |  1 +
 ...irt-9.4.0-r3.ebuild => libvirt-9.4.0-r4.ebuild} |  1 +
 ...ibvirt-9.5.0.ebuild => libvirt-9.5.0-r1.ebuild} |  1 +
 4 files changed, 60 insertions(+)

diff --git a/app-emulation/libvirt/files/libvirt-9.6.0-storage-Fix-returning-of-locked-objects-from-virStor.patch b/app-emulation/libvirt/files/libvirt-9.6.0-storage-Fix-returning-of-locked-objects-from-virStor.patch
new file mode 100644
index 000000000000..b2e1b3536227
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-9.6.0-storage-Fix-returning-of-locked-objects-from-virStor.patch
@@ -0,0 +1,57 @@
+From 9a47442366fcf8a7b6d7422016d7bbb6764a1098 Mon Sep 17 00:00:00 2001
+Message-ID: <9a47442366fcf8a7b6d7422016d7bbb6764a1098.1698742017.git.mprivozn@redhat.com>
+From: Peter Krempa <pkrempa@redhat.com>
+Date: Thu, 13 Jul 2023 16:16:37 +0200
+Subject: [PATCH] storage: Fix returning of locked objects from
+ 'virStoragePoolObjListSearch'
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+CVE-2023-3750
+
+'virStoragePoolObjListSearch' explicitly documents that it's returning
+a pointer to a locked and ref'd pool that maches the lookup function.
+
+This was not the case as in commit 0c4b391e2a9 (released in
+libvirt-8.3.0) the code was accidentally converted to use 'VIR_LOCK_GUARD'
+which auto-unlocked it when leaving the scope, even when the code was
+originally "leaking" the lock.
+
+Revert the corresponding conversion and add a comment that this function
+is intentionally leaking a locked object.
+
+Fixes: 0c4b391e2a9
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2221851
+Signed-off-by: Peter Krempa <pkrempa@redhat.com>
+Reviewed-by: Ján Tomko <jtomko@redhat.com>
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ src/conf/virstorageobj.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
+index 7010e97d61..59fa5da372 100644
+--- a/src/conf/virstorageobj.c
++++ b/src/conf/virstorageobj.c
+@@ -454,11 +454,16 @@ virStoragePoolObjListSearchCb(const void *payload,
+     virStoragePoolObj *obj = (virStoragePoolObj *) payload;
+     struct _virStoragePoolObjListSearchData *data =
+         (struct _virStoragePoolObjListSearchData *)opaque;
+-    VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
+ 
++    virObjectLock(obj);
++
++    /* If we find the matching pool object we must return while the object is
++     * locked as the caller wants to return a locked object. */
+     if (data->searcher(obj, data->opaque))
+         return 1;
+ 
++    virObjectUnlock(obj);
++
+     return 0;
+ }
+ 
+-- 
+2.41.0
+

diff --git a/app-emulation/libvirt/libvirt-9.3.0.ebuild b/app-emulation/libvirt/libvirt-9.3.0-r1.ebuild
similarity index 99%
rename from app-emulation/libvirt/libvirt-9.3.0.ebuild
rename to app-emulation/libvirt/libvirt-9.3.0-r1.ebuild
index 35e25c535b20..fb7df1f1d07e 100644
--- a/app-emulation/libvirt/libvirt-9.3.0.ebuild
+++ b/app-emulation/libvirt/libvirt-9.3.0-r1.ebuild
@@ -145,6 +145,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-6.0.0-fix_paths_in_libvirt-guests_sh.patch
 	"${FILESDIR}"/${PN}-8.2.0-do-not-use-sysconfig.patch
 	"${FILESDIR}"/${PN}-8.2.0-fix-paths-for-apparmor.patch
+	"${FILESDIR}"/${PN}-9.6.0-storage-Fix-returning-of-locked-objects-from-virStor.patch
 )
 
 pkg_setup() {

diff --git a/app-emulation/libvirt/libvirt-9.4.0-r3.ebuild b/app-emulation/libvirt/libvirt-9.4.0-r4.ebuild
similarity index 99%
rename from app-emulation/libvirt/libvirt-9.4.0-r3.ebuild
rename to app-emulation/libvirt/libvirt-9.4.0-r4.ebuild
index 1118dfad61ae..360f8a9efd17 100644
--- a/app-emulation/libvirt/libvirt-9.4.0-r3.ebuild
+++ b/app-emulation/libvirt/libvirt-9.4.0-r4.ebuild
@@ -146,6 +146,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch
 	"${FILESDIR}"/${PN}-9.4.0-do-not-use-sysconfig.patch
 	"${FILESDIR}"/${PN}-9.4.0-fix-paths-for-apparmor.patch
+	"${FILESDIR}"/${PN}-9.6.0-storage-Fix-returning-of-locked-objects-from-virStor.patch
 )
 
 pkg_setup() {

diff --git a/app-emulation/libvirt/libvirt-9.5.0.ebuild b/app-emulation/libvirt/libvirt-9.5.0-r1.ebuild
similarity index 99%
rename from app-emulation/libvirt/libvirt-9.5.0.ebuild
rename to app-emulation/libvirt/libvirt-9.5.0-r1.ebuild
index 0a0255e18fcf..79a057763a8a 100644
--- a/app-emulation/libvirt/libvirt-9.5.0.ebuild
+++ b/app-emulation/libvirt/libvirt-9.5.0-r1.ebuild
@@ -146,6 +146,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch
 	"${FILESDIR}"/${PN}-9.4.0-do-not-use-sysconfig.patch
 	"${FILESDIR}"/${PN}-9.4.0-fix-paths-for-apparmor.patch
+	"${FILESDIR}"/${PN}-9.6.0-storage-Fix-returning-of-locked-objects-from-virStor.patch
 )
 
 pkg_setup() {


             reply	other threads:[~2023-10-31 16:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 16:25 Matthias Maier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-14  0:43 [gentoo-commits] repo/gentoo:master commit in: app-emulation/libvirt/, app-emulation/libvirt/files/ Sam James
2024-04-14  0:43 Sam James
2024-03-04 10:28 Sam James
2024-02-29  0:22 Sam James
2023-06-21 21:48 Matthias Maier
2023-06-18  1:54 Matthias Maier
2023-06-10 16:59 Sam James
2022-09-23  1:06 Sam James
2022-08-03 18:21 Sam James
2022-03-02 17:36 Joonas Niilola
2022-02-21 23:14 Sam James
2022-01-04 16:33 Matthias Maier
2021-04-04 17:49 Matthias Maier
2020-12-07  8:53 Sergei Trofimovich
2020-11-10  0:34 Matthias Maier
2020-07-21 18:11 Marek Szuba
2020-04-06 17:46 Matthias Maier
2020-04-05 17:19 Matthias Maier
2020-03-15 21:14 Matthias Maier
2020-02-06 15:52 Matthias Maier
2020-02-03  3:07 Matthias Maier
2019-08-05 15:03 Matthias Maier
2019-07-09 19:06 Matthias Maier
2019-07-09 18:54 Matthias Maier
2019-07-01 15:07 Matthias Maier
2019-07-01 14:27 Matthias Maier
2019-05-19 23:42 Matthias Maier
2019-03-17  7:27 Matthias Maier
2018-12-26  3:27 Matthias Maier
2018-08-19 19:08 Matthias Maier
2018-07-03 15:30 Matthias Maier
2018-06-29  4:50 Matthias Maier
2018-06-29  4:50 Matthias Maier
2018-03-23 14:16 Matthias Maier
2017-12-07 16:08 Matthias Maier
2017-09-01  2:01 Matthias Maier
2017-09-01  2:01 Matthias Maier
2017-05-06 18:27 Matthias Maier
2017-01-22 15:34 Matthias Maier
2016-07-09 15:10 Matthias Maier
2016-06-30 18:02 Matthias Maier
2016-05-01 19:15 Matthias Maier
2016-03-11  7:45 Matthias Maier
2016-01-07  8:18 Matthias Maier
2015-12-22 16:13 Matthias Maier
2015-10-05  6:32 Matthias Maier
2015-08-14  3:48 Matthias Maier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1698769518.42fd27c7046a483b588a8e4e59f6ab8c1d2edcc2.tamiko@gentoo \
    --to=tamiko@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox