From: Oliver Kurth Date: Wed, 11 Dec 2019 18:19:08 +0000 (-0800) Subject: Avoid securing disk device info for ZFS pools (at this time) X-Git-Tag: stable-11.0.5~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08f1a0270922b53e9309cf5d0a253c3df3dcc508;p=thirdparty%2Fopen-vm-tools.git Avoid securing disk device info for ZFS pools (at this time) ZFS filesystem pools device names can appear as single directory name at the root directory. The current logic to locate the /sys/class/blocks/ PCI structure based on typical device name format will fail for ZFS pools. As an immediate fix to the SIGSEGV, avoid attempting to locate the PCI info; keep vmtoolsd running. Addresses https://github.com/vmware/open-vm-tools/issues/378 --- diff --git a/open-vm-tools/services/plugins/guestInfo/diskInfo.c b/open-vm-tools/services/plugins/guestInfo/diskInfo.c index a8234a4ca..878276ce7 100644 --- a/open-vm-tools/services/plugins/guestInfo/diskInfo.c +++ b/open-vm-tools/services/plugins/guestInfo/diskInfo.c @@ -825,10 +825,19 @@ GuestInfoGetDiskDevice(const char *fsName, /* Not an LVM; check if a basic block device. */ char blockDevPath[PATH_MAX]; + const char *baseDevName = strrchr(fsName, '/'); - Str_Snprintf(blockDevPath, PATH_MAX, "%s/%s", LINUX_SYS_BLOCK_DIR, - strrchr(fsName, '/') + 1); - GuestInfoLinuxBlockDevice(blockDevPath, partEntry, 1 /* first and only*/); + /* + * ZFS pools are not currently handled and may consist of a simple file + * name. Neither situation can currently be handled in the PCI device + * lookup; avoid at this time. + */ + if (baseDevName != NULL && strcmp(partEntry->fsType, "zfs") != 0) { + Str_Snprintf(blockDevPath, PATH_MAX, "%s/%s", LINUX_SYS_BLOCK_DIR, + baseDevName + 1); + /* First and only disk device. */ + GuestInfoLinuxBlockDevice(blockDevPath, partEntry, 1); + } } /*