From 510c97f4039f9a09a67795c758bb070bd0ae9617 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 27 2021 07:55:58 +0000 Subject: import open-vm-tools-11.0.5-3.el7_9.3 --- diff --git a/SOURCES/ovt-Fix-memory-leaks-in-guestInfo-diskInfo.c.patch b/SOURCES/ovt-Fix-memory-leaks-in-guestInfo-diskInfo.c.patch new file mode 100644 index 0000000..d16fee2 --- /dev/null +++ b/SOURCES/ovt-Fix-memory-leaks-in-guestInfo-diskInfo.c.patch @@ -0,0 +1,63 @@ +From 1df114456e53479bad9ece58f2fb6602dc31b9af Mon Sep 17 00:00:00 2001 +From: Cathy Avery +Date: Thu, 25 Mar 2021 13:18:52 -0400 +Subject: [PATCH] Fix memory leaks in guestInfo/diskInfo.c. + +RH-Author: Cathy Avery +RH-MergeRequest: 1: Fix memory leaks in guestInfo/diskInfo.c. +RH-Commit: [1/1] ddc8da05f5d6ae36d32b99a8100026f3ac1badbe (cavery/open-vm-tools) +RH-Bugzilla: 1937420 +RH-Acked-by: Acked-by: Mohammed Gamal +RH-Acked-by: Acked-by: Vitaly Kuznetsov vkuznets@redhat.com + +When checking for IDE, SATA and SAS disk drives, the glib GMatchInfo is +passed to a g_regex_match() function inside a for loop. It was not +properly passed to g_match_info_free() before subsequently being reused. + +This addresses https://github.com/vmware/open-vm-tools/issues/452 + +(cherry picked from commit 25c2e973583cf189995c9638701e4bef9e1c851c) +Signed-off-by: Cathy Avery +--- + open-vm-tools/services/plugins/guestInfo/diskInfo.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/open-vm-tools/services/plugins/guestInfo/diskInfo.c b/open-vm-tools/services/plugins/guestInfo/diskInfo.c +index 032c0928..e63d232a 100644 +--- a/open-vm-tools/services/plugins/guestInfo/diskInfo.c ++++ b/open-vm-tools/services/plugins/guestInfo/diskInfo.c +@@ -270,6 +270,7 @@ GuestInfoGetIdeSataDev(const char *tgtHostPath, + regexAtaOrHost = regexAta; + + } else { ++ g_match_info_free(matchInfo); + COMP_STATIC_REGEX(regexHostPath, "^.*/host(\\d+)$", gErr, exit) + if (g_regex_match(regexHostPath, realPath, 0, &matchInfo)) { + COMP_STATIC_REGEX(regexHost, "^host(\\d+)$", gErr, exit) +@@ -296,6 +297,7 @@ GuestInfoGetIdeSataDev(const char *tgtHostPath, + for (fileNum = 0; fileNum < numFiles; fileNum++) { + int currHost; + ++ g_match_info_free(matchInfo); + if (g_regex_match(regexAtaOrHost, fileNameList[fileNum], 0, &matchInfo)) { + g_free(charHost); + charHost = g_match_info_fetch(matchInfo, 1); +@@ -431,6 +433,7 @@ GuestInfoCheckSASDevice(char *pciDevPath, + pciDevPath); + } + for (fileNum = 0; fileNum < numFiles; fileNum++) { ++ g_match_info_free(matchInfo); + if (g_regex_match(regexSas, fileNameList[fileNum], 0, &matchInfo)) { + free(*unit); /* free previous "unit" string */ + *unit = g_match_info_fetch(matchInfo, 1); +@@ -659,6 +662,7 @@ GuestInfoLinuxBlockDevice(const char *startPath, + /* Check for NVMe device. */ + COMP_STATIC_REGEX(regexNvme, "^.*/nvme\\d+$", gErr, finished) + ++ g_match_info_free(matchInfo); + if (!g_regex_match(regexNvme, realPath, 0, &matchInfo)) { + g_debug("%s: block disk device pattern not found\n", __FUNCTION__); + goto finished; +-- +2.27.0 + diff --git a/SPECS/open-vm-tools.spec b/SPECS/open-vm-tools.spec index 7cfed32..9fef4b1 100644 --- a/SPECS/open-vm-tools.spec +++ b/SPECS/open-vm-tools.spec @@ -28,7 +28,7 @@ Name: open-vm-tools Version: %{toolsversion} -Release: 3%{?dist}.2 +Release: 3%{?dist}.3 Summary: Open Virtual Machine Tools for virtual machines hosted on VMware Group: Applications/System License: GPLv2 @@ -40,7 +40,7 @@ Source3: run-vmblock\x2dfuse.mount Source4: open-vm-tools.conf Source5: vmtoolsd.pam -ExclusiveArch: x86_64 %{ix86} +ExclusiveArch: x86_64 Patch0002: 0002-Fix-RELRO-flag.patch # For bz#1809753 - [ESXi][RHEL7.9]open-vm-tools add appinfo plugin patch @@ -51,6 +51,8 @@ Patch4: ovt-Fix-a-trivial-memory-leak-in-namespacetool.c.patch Patch5: ovt-Update-copyright-to-reflect-previous-change.patch # For bz#1911853 - [ESXi][RHEL7.9][ warning] [guestinfo] GuestInfoGetDiskDevice: Missing disk device name; VMDK mapping unavailable for "/", fsName: "/dev/sda2" Patch6: ovt-Rectify-a-log-spew-in-vmsvc-logging-vmware-vmsvc-roo.patch +# For bz#1937420 - [ESXi][RHEL7.9] Memory leak in vmtoolsd when disable-query-diskinfo is set to false [rhel-7.9.z] +Patch7: ovt-Fix-memory-leaks-in-guestInfo-diskInfo.c.patch BuildRequires: autoconf BuildRequires: automake @@ -331,6 +333,11 @@ fi %{_bindir}/vmware-vgauth-smoketest %changelog +* Tue Apr 06 2021 Miroslav Rezanina - 11.0.5-3.el7_9.3 +- ovt-Fix-memory-leaks-in-guestInfo-diskInfo.c.patch [bz#1937420] +- Resolves: bz#1937420 + ([ESXi][RHEL7.9] Memory leak in vmtoolsd when disable-query-diskinfo is set to false [rhel-7.9.z]) + * Tue Feb 16 2021 Jon Maloy - 11.0.5-3.el7_9.2 - ovt-Rectify-a-log-spew-in-vmsvc-logging-vmware-vmsvc-roo.patch [bz#1911853] - Resolves: bz#1911853