diff --git a/1000-Do-not-remove-temp-dtrace-probe-files.patch b/1000-Do-not-remove-temp-dtrace-probe-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..781dc7f54ebb468121d45ec79e6d4de74d7052b7 --- /dev/null +++ b/1000-Do-not-remove-temp-dtrace-probe-files.patch @@ -0,0 +1,47 @@ +From 5e5efc07947598de75f63380d48fa5b962fbadd9 Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Tue, 17 Nov 2020 02:00:28 -0500 +Subject: [PATCH] Do not remove temp dtrace probe files + +Build hit error with dtrace enabled: +File "/usr/bin/dtrace", line 432, in main + os.remove(fname) +FileNotFoundError: [Errno 2] No such file or directory: '../src/libvirt_probes.o.dtrace-temp.c' + +Remove a temp file that doesn't exists could cause build failure. update Makefile +to keep temp dtrace files. + +Signed-off-by: Liwei Ge +--- + src/Makefile.am | 2 +- + src/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index c9b5eeb..e90b313 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -475,7 +475,7 @@ tapset_DATA += libvirt_probes.stp libvirt_functions.stp + + .PRECIOUS: %_probes.o + %_probes.o: %_probes.d +- $(AM_V_GEN)$(DTRACE) -o $@ -G -s $< ++ $(AM_V_GEN)$(DTRACE) -k -o $@ -G -s $< + + %_probes.lo: %_probes.o + $(AM_V_GEN)printf %s\\n \ +diff --git a/src/Makefile.in b/src/Makefile.in +index c114180..6b43808 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -15856,7 +15856,7 @@ libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \ + + @WITH_DTRACE_PROBES_TRUE@.PRECIOUS: %_probes.o + @WITH_DTRACE_PROBES_TRUE@%_probes.o: %_probes.d +-@WITH_DTRACE_PROBES_TRUE@ $(AM_V_GEN)$(DTRACE) -o $@ -G -s $< ++@WITH_DTRACE_PROBES_TRUE@ $(AM_V_GEN)$(DTRACE) -k -o $@ -G -s $< + + @WITH_DTRACE_PROBES_TRUE@%_probes.lo: %_probes.o + @WITH_DTRACE_PROBES_TRUE@ $(AM_V_GEN)printf %s\\n \ +-- +2.18.1 diff --git a/1001-use-correct-backendType-when-checking-memfd-capability.patch b/1001-use-correct-backendType-when-checking-memfd-capability.patch new file mode 100644 index 0000000000000000000000000000000000000000..ecc497acda668085068865819a181504dcfb27f5 --- /dev/null +++ b/1001-use-correct-backendType-when-checking-memfd-capability.patch @@ -0,0 +1,38 @@ +From 8400b6c1983dd1e4504fe19d3421fff0e5866091 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Mon, 24 Feb 2020 13:32:30 +0100 +Subject: [PATCH] qemu: use correct backendType when checking memfd capability +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The backend name is memory-backend-memfd but we've been checking +for memory-backend-memory. + +Reported by GCC on rawhide: +../../../src/internal.h:75:22: error: 'strcmp' of a string of length 21 and +an array of size 21 evaluates to nonzero [-Werror=string-compare] +../../../src/qemu/qemu_command.c:3525:20: note: in expansion of macro 'STREQ' + 3525 | } else if (STREQ(backendType, "memory-backend-memory") && + | ^~~~~ + +Signed-off-by: Ján Tomko +Fixes: 24b74d187cab48a9dc9f409ea78900154c709579 +Reviewed-by: Daniel P. Berrangé +--- + src/qemu/qemu_command.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index f69a9e651c..6d5b53d30a 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -3522,7 +3522,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, + _("this qemu doesn't support the " + "memory-backend-ram object")); + return -1; +- } else if (STREQ(backendType, "memory-backend-memory") && ++ } else if (STREQ(backendType, "memory-backend-memfd") && + !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_MEMFD)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this qemu doesn't support the " diff --git a/1002-fix-use-after-free.patch b/1002-fix-use-after-free.patch new file mode 100644 index 0000000000000000000000000000000000000000..dbaf3b7eff93db8f406013de14a27328dbbffe43 --- /dev/null +++ b/1002-fix-use-after-free.patch @@ -0,0 +1,37 @@ +From 679fcfe96923231d065d3e98e0251f1c3282a971 Mon Sep 17 00:00:00 2001 +From: Ryan Moeller +Date: Mon, 24 Feb 2020 01:46:14 -0500 +Subject: [PATCH] conf: fix use after free +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Reviewed-by: Daniel P. Berrangé +Signed-off-by: Ryan Moeller +--- + src/conf/virnetworkobj.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c +index 299cdba52d..b2affaacd3 100644 +--- a/src/conf/virnetworkobj.c ++++ b/src/conf/virnetworkobj.c +@@ -1886,7 +1886,7 @@ virNetworkObjLoadAllPorts(virNetworkObjPtr net, + } + + while ((rc = virDirRead(dh, &de, dir)) > 0) { +- char *file = NULL; ++ g_autofree char *file = NULL; + + if (!virStringStripSuffix(de->d_name, ".xml")) + continue; +@@ -1894,9 +1894,6 @@ virNetworkObjLoadAllPorts(virNetworkObjPtr net, + file = g_strdup_printf("%s/%s.xml", dir, de->d_name); + + portdef = virNetworkPortDefParseFile(file); +- VIR_FREE(file); +- file = NULL; +- + if (!portdef) { + VIR_WARN("Cannot parse port %s", file); + continue; diff --git a/libvirt.spec b/libvirt.spec index 77dcce6689f73c6e4f605e3396da374c6241c1d9..c7c02acd52ce660aadacca5d89d4c04ed561eee0 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -1,5 +1,5 @@ # -*- rpm-spec -*- - +%define anolis_release .0.1 # This spec file assumes you are building on a Fedora or RHEL version # that's still supported by the vendor. It may work on other distros # or versions, but no effort will be made to ensure that going forward. @@ -219,7 +219,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 6.0.0 -Release: 37.1%{?dist}%{?extra_release} +Release: 37.1%{anolis_release}%{?dist}%{?extra_release} License: LGPLv2+ URL: https://libvirt.org/ @@ -775,6 +775,12 @@ Patch543: libvirt-storage_driver-Unlock-object-on-ACL-fail-in-storagePoolLookupB Patch544: libvirt-network-Implement-virConnectSupportsFeature.patch Patch545: libvirt-lib-Fix-calling-of-virNetworkUpdate-driver-callback.patch +# Begin: Anolis customized patches +Patch1000: 1000-Do-not-remove-temp-dtrace-probe-files.patch +Patch1001: 1001-use-correct-backendType-when-checking-memfd-capability.patch +Patch1002: 1002-fix-use-after-free.patch +# End: Anolis customized patches + Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} @@ -2550,6 +2556,11 @@ exit 0 %changelog +* Thu Feb 10 2022 Liwei Ge - 6.0.0-37.1.0.1 +- Do not remove dtrace temp files(Liwei Ge) +- Use correct backendType when checking memfd capability(Weitao Zhou) +- Fix use after free of var file(Weitao Zhou) + * Thu Jan 13 2022 Jiri Denemark - 6.0.0-37.1.el8 - network: Implement virConnectSupportsFeature() (rhbz#2038812) - lib: Fix calling of virNetworkUpdate() driver callback (rhbz#2038812)