From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: Changqing Li <changqing.li@windriver.com>
Cc: meta-virtualization@lists.yoctoproject.org
Subject: Re: [meta-virtualization] [hardknott][PATCH] libvirt: fix CVE-2021-3975
Date: Fri, 4 Feb 2022 12:22:18 -0500 [thread overview]
Message-ID: <20220204172217.GD451@gmail.com> (raw)
In-Reply-To: <20220129071457.45838-1-changqing.li@windriver.com>
merged to hardknott.
Bruce
In message: [meta-virtualization] [hardknott][PATCH] libvirt: fix CVE-2021-3975
on 29/01/2022 Changqing Li wrote:
> From: Changqing Li <changqing.li@windriver.com>
>
> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ---
> .../libvirt/libvirt/CVE-2021-3975.patch | 43 +++++++++++++++++++
> recipes-extended/libvirt/libvirt_6.3.0.bb | 1 +
> 2 files changed, 44 insertions(+)
> create mode 100644 recipes-extended/libvirt/libvirt/CVE-2021-3975.patch
>
> diff --git a/recipes-extended/libvirt/libvirt/CVE-2021-3975.patch b/recipes-extended/libvirt/libvirt/CVE-2021-3975.patch
> new file mode 100644
> index 0000000..72cee94
> --- /dev/null
> +++ b/recipes-extended/libvirt/libvirt/CVE-2021-3975.patch
> @@ -0,0 +1,43 @@
> +From 30de45c73106cacfc0aacc8f11c88e1aa5372d77 Mon Sep 17 00:00:00 2001
> +From: Changqing Li <changqing.li@windriver.com>
> +Date: Sat, 29 Jan 2022 13:25:54 +0800
> +Subject: [PATCH] qemu: Add missing lock in qemuProcessHandleMonitorEOF
> +
> +qemuMonitorUnregister will be called in multiple threads (e.g. threads
> +in rpc worker pool and the vm event thread). In some cases, it isn't
> +protected by the monitor lock, which may lead to call g_source_unref
> +more than one time and a use-after-free problem eventually.
> +
> +Add the missing lock in qemuProcessHandleMonitorEOF (which is the only
> +position missing lock of monitor I found).
> +
> +Suggested-by: Michal Privoznik <mprivozn@redhat.com>
> +Signed-off-by: Peng Liang <liangpeng10@huawei.com>
> +Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> +Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
> +
> +Upstream-Status: Backport [https://github.com/libvirt/libvirt/commit/1ac703a7d0789e46833f4013a3876c2e3af18ec7]
> +CVE: CVE-2021-3975
> +
> +Signed-off-by: Changqing Li <changqing.li@windriver.com>
> +---
> + src/qemu/qemu_process.c | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> +index 8ea470f..64b8472 100644
> +--- a/src/qemu/qemu_process.c
> ++++ b/src/qemu/qemu_process.c
> +@@ -315,7 +315,9 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon,
> + /* We don't want this EOF handler to be called over and over while the
> + * thread is waiting for a job.
> + */
> ++ virObjectLock(mon);
> + qemuMonitorUnregister(mon);
> ++ virObjectUnlock(mon);
> +
> + /* We don't want any cleanup from EOF handler (or any other
> + * thread) to enter qemu namespace. */
> +--
> +2.17.1
> +
> diff --git a/recipes-extended/libvirt/libvirt_6.3.0.bb b/recipes-extended/libvirt/libvirt_6.3.0.bb
> index 091296e..8e95ad6 100644
> --- a/recipes-extended/libvirt/libvirt_6.3.0.bb
> +++ b/recipes-extended/libvirt/libvirt_6.3.0.bb
> @@ -46,6 +46,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \
> file://CVE-2020-25637_4.patch \
> file://CVE-2021-3631.patch \
> file://0001-storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch \
> + file://CVE-2021-3975.patch \
> "
>
> SRC_URI[libvirt.md5sum] = "1bd4435f77924f5ec9928b538daf4a02"
> --
> 2.17.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#7038): https://lists.yoctoproject.org/g/meta-virtualization/message/7038
> Mute This Topic: https://lists.yoctoproject.org/mt/88762739/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
prev parent reply other threads:[~2022-02-04 17:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-29 7:14 [hardknott][PATCH] libvirt: fix CVE-2021-3975 changqing.li
2022-02-04 17:22 ` Bruce Ashfield [this message]
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=20220204172217.GD451@gmail.com \
--to=bruce.ashfield@gmail.com \
--cc=changqing.li@windriver.com \
--cc=meta-virtualization@lists.yoctoproject.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