From d8ea841ee85896ba6f3acf5123816c76c32103f9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 27 Feb 2023 16:09:52 +0000 Subject: [PATCH] Fix build with glib2 2.75.3 (RHBZ#2173639) --- ...sgx_epc_get_section-stub-is-reachabl.patch | 2 +- ...sts-Disable-pci_virtio_vga-for-ppc64.patch | 2 +- ...er-add-more-compat-ioctl-definitions.patch | 2 +- ...r-fix-compat-with-glibc-2.36-sys-mou.patch | 2 +- ...-zeroes-with-BDRV_REQ_REGISTERED_BUF.patch | 2 +- ...te-fix-bad-GTree-usage-use-after-fre.patch | 43 +++++++++++++++++++ qemu.spec | 6 +++ 7 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 0006-PATCH-test-vmstate-fix-bad-GTree-usage-use-after-fre.patch diff --git a/0001-target-i386-the-sgx_epc_get_section-stub-is-reachabl.patch b/0001-target-i386-the-sgx_epc_get_section-stub-is-reachabl.patch index 92a74eb..3f0bae7 100644 --- a/0001-target-i386-the-sgx_epc_get_section-stub-is-reachabl.patch +++ b/0001-target-i386-the-sgx_epc_get_section-stub-is-reachabl.patch @@ -1,7 +1,7 @@ From e54512fe75f85640c0c73e53e6f8bd0b9d193529 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 1 Feb 2022 20:09:37 +0100 -Subject: [PATCH 1/5] target/i386: the sgx_epc_get_section stub is reachable +Subject: [PATCH 1/6] target/i386: the sgx_epc_get_section stub is reachable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0002-tests-Disable-pci_virtio_vga-for-ppc64.patch b/0002-tests-Disable-pci_virtio_vga-for-ppc64.patch index 2172c4d..c940f0d 100644 --- a/0002-tests-Disable-pci_virtio_vga-for-ppc64.patch +++ b/0002-tests-Disable-pci_virtio_vga-for-ppc64.patch @@ -1,7 +1,7 @@ From 2f0a0afbf915d36c39c5cfac1e31c6edc7f47bef Mon Sep 17 00:00:00 2001 From: "Eduardo Lima (Etrunko)" Date: Thu, 1 Sep 2022 12:43:49 -0300 -Subject: [PATCH 2/5] tests: Disable pci_virtio_vga for ppc64 +Subject: [PATCH 2/6] tests: Disable pci_virtio_vga for ppc64 starting QEMU: exec ./qemu-system-ppc64 -qtest unix:/tmp/qtest-2378197.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-2378197.qmp,id=char0 -mon chardev=char0,mode=control -display none -vga none -device virtio-vga -accel qtest stderr: diff --git a/0003-Revert-linux-user-add-more-compat-ioctl-definitions.patch b/0003-Revert-linux-user-add-more-compat-ioctl-definitions.patch index 7a7ec1c..e0c2b92 100644 --- a/0003-Revert-linux-user-add-more-compat-ioctl-definitions.patch +++ b/0003-Revert-linux-user-add-more-compat-ioctl-definitions.patch @@ -1,7 +1,7 @@ From 5c1d2f920c14d6e8f4ac7abc62714eadaa60f228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 10 Jan 2023 12:37:14 -0500 -Subject: [PATCH 3/5] Revert "linux-user: add more compat ioctl definitions" +Subject: [PATCH 3/6] Revert "linux-user: add more compat ioctl definitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0004-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch b/0004-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch index 43b10c7..b872587 100644 --- a/0004-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch +++ b/0004-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch @@ -1,7 +1,7 @@ From b40cf0a490c28d5b79e05382d061983b92a7b2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 10 Jan 2023 12:37:25 -0500 -Subject: [PATCH 4/5] Revert "linux-user: fix compat with glibc >= 2.36 +Subject: [PATCH 4/6] Revert "linux-user: fix compat with glibc >= 2.36 sys/mount.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 diff --git a/0005-block-fix-detect-zeroes-with-BDRV_REQ_REGISTERED_BUF.patch b/0005-block-fix-detect-zeroes-with-BDRV_REQ_REGISTERED_BUF.patch index 989e7eb..54ea7bd 100644 --- a/0005-block-fix-detect-zeroes-with-BDRV_REQ_REGISTERED_BUF.patch +++ b/0005-block-fix-detect-zeroes-with-BDRV_REQ_REGISTERED_BUF.patch @@ -1,7 +1,7 @@ From db788c896eb1378ebc1f20dcc4954616a7631919 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Tue, 7 Feb 2023 15:37:16 -0500 -Subject: [PATCH 5/5] block: fix detect-zeroes= with BDRV_REQ_REGISTERED_BUF +Subject: [PATCH 5/6] block: fix detect-zeroes= with BDRV_REQ_REGISTERED_BUF When a write request is converted into a write zeroes request by the detect-zeroes= feature, it is no longer associated with an I/O buffer. diff --git a/0006-PATCH-test-vmstate-fix-bad-GTree-usage-use-after-fre.patch b/0006-PATCH-test-vmstate-fix-bad-GTree-usage-use-after-fre.patch new file mode 100644 index 0000000..f4ff87f --- /dev/null +++ b/0006-PATCH-test-vmstate-fix-bad-GTree-usage-use-after-fre.patch @@ -0,0 +1,43 @@ +From 930def8769940600dd7dd587ec2accd4a8b6e1f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Mon, 27 Feb 2023 16:02:51 +0000 +Subject: [PATCH 6/6] [PATCH] test-vmstate: fix bad GTree usage, use-after-free +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +According to g_tree_foreach() documentation: +"The tree may not be modified while iterating over it (you can't +add/remove items)." + +Fixes: 9a85e4b8f6 ("migration: Support gtree migration") +Cc: Eric Auger +Signed-off-by: Marc-André Lureau +--- + tests/unit/test-vmstate.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c +index 541bb4f63e..36b253eb67 100644 +--- a/tests/unit/test-vmstate.c ++++ b/tests/unit/test-vmstate.c +@@ -1074,7 +1074,6 @@ static gboolean diff_tree(gpointer key, gpointer value, gpointer data) + struct match_node_data d = {tp->tree2, key, value}; + + g_tree_foreach(tp->tree2, tp->match_node, &d); +- g_tree_remove(tp->tree1, key); + return false; + } + +@@ -1084,7 +1083,7 @@ static void compare_trees(GTree *tree1, GTree *tree2, + struct tree_cmp_data tp = {tree1, tree2, function}; + + g_tree_foreach(tree1, diff_tree, &tp); +- assert(g_tree_nnodes(tree1) == 0); ++ g_tree_destroy(g_tree_ref(tree1)); + assert(g_tree_nnodes(tree2) == 0); + } + +-- +2.37.3 + diff --git a/qemu.spec b/qemu.spec index 7e1924e..2ed7574 100644 --- a/qemu.spec +++ b/qemu.spec @@ -352,6 +352,11 @@ Patch: 0003-Revert-linux-user-add-more-compat-ioctl-definitions.patch Patch: 0004-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch # Fix virtio-blk-pci detect-zeroes=unmap (RHBZ#2173357) Patch: 0005-block-fix-detect-zeroes-with-BDRV_REQ_REGISTERED_BUF.patch +# Fix build with glib2 2.75.3 +# https://bugzilla.redhat.com/show_bug.cgi?id=2173639 +# https://gitlab.com/qemu-project/qemu/-/issues/1518 +# Patch is NOT UPSTREAM. +Patch: 0006-PATCH-test-vmstate-fix-bad-GTree-usage-use-after-fre.patch BuildRequires: meson >= %{meson_version} BuildRequires: zlib-devel @@ -2783,6 +2788,7 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %changelog * Mon Feb 27 2023 Richard W.M. Jones - 7.2.0-7 - Fix virtio-blk-pci detect-zeroes=unmap (RHBZ#2173357) +- Fix build with glib2 2.75.3 (RHBZ#2173639) * Tue Jan 31 2023 Stefan Hajnoczi - 7.2.0-6 - Enable libblkio