Bug 1678576
| Summary: | [ESXi][RHEL7.6] Several files lost Full RELRO | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Miroslav Rezanina <mrezanin> |
| Component: | open-vm-tools | Assignee: | Cathy Avery <cavery> |
| Status: | CLOSED ERRATA | QA Contact: | Bo Yang <boyang> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 7.6 | CC: | boyang, cavery, jen, jjarvis, jsavanyo, ldu, leiwang, ravindrakumar, vmware-gos-qa, yacao |
| Target Milestone: | rc | Keywords: | Regression |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | open-vm-tools-10.3.0-2.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-08-06 12:57:03 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Miroslav Rezanina
2019-02-19 06:49:31 UTC
WW08.2 UPDATE: Reproduced this BZ in RHEL7.6 with open-vm-tools-10.3.0-1.el7. But same files have Full RELRO in RHEL8 with open-vm-tools-10.3.0-2.el8.x86_64. ENV: Host: VMware ESXi, 6.7.0, 10764712 Guest: RHEL7.6 / RHEL8.0 OVT: open-vm-tools-10.3.0-1.el7 / open-vm-tools-10.3.0-2.el8.x86_64 Steps to Reproduce: 1. Confirm RHEL7.6 and RHEL8.0.0's OVT version 2. Tool checksec to check target files marked in description 3. Check their results Results: 1. After step 3, target files lost Full RELRO in RHEL7.6 Jeff Law of the tools group informed Mirek and myself that RHEL 8 has RELRO on by default and RHEL 7 does not. He indicated that using -Wl,-z,relro,-z,now in the gcc line should force RELRO. Thanks Cathy. This is not a regression. I'm wondering if this bug is even valid? Here are the checksec results from RHEL 7.4: # cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.4 (Maipo) # rpm -qa open-vm-tools open-vm-tools-10.1.5-3.el7.x86_64 # for f in `rpm -ql open-vm-tools | grep "bin\|plugins"`;do ./checksec --file $f;done RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 5 9 /usr/bin/VGAuthService Error: Not an ELF file: /usr/bin/vm-support: POSIX shell script, ASCII text executable RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 2 6 /usr/bin/vmhgfs-fuse RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 0 1 /usr/bin/vmtoolsd RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 1 1 /usr/bin/vmware-checkvm RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 2 2 /usr/bin/vmware-guestproxycerttool RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 0 0 /usr/bin/vmware-hgfsclient RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 2 2 /usr/bin/vmware-namespace-cmd RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 2 7 /usr/bin/vmware-rpctool RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 0 0 /usr/bin/vmware-toolbox-cmd RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 0 0 /usr/bin/vmware-vgauth-cmd RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols Yes 1 3 /usr/bin/vmware-xferlogs Error: Not an ELF file: /usr/lib64/open-vm-tools/plugins: directory Error: Not an ELF file: /usr/lib64/open-vm-tools/plugins/common: directory RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols Yes 0 0 /usr/lib64/open-vm-tools/plugins/common/libhgfsServer.so RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols Yes 0 2 /usr/lib64/open-vm-tools/plugins/common/libvix.so Error: Not an ELF file: /usr/lib64/open-vm-tools/plugins/vmsvc: directory RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols Yes 1 1 /usr/lib64/open-vm-tools/plugins/vmsvc/libdeployPkgPlugin.so RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols Yes 0 1 /usr/lib64/open-vm-tools/plugins/vmsvc/libgrabbitmqProxy.so RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols Yes 0 2 /usr/lib64/open-vm-tools/plugins/vmsvc/libguestInfo.so RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols Yes 0 0 /usr/lib64/open-vm-tools/plugins/vmsvc/libpowerOps.so RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols Yes 0 0 /usr/lib64/open-vm-tools/plugins/vmsvc/libtimeSync.so RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO Canary found NX enabled DSO No RPATH No RUNPATH No Symbols Yes 0 0 /usr/lib64/open-vm-tools/plugins/vmsvc/libvmbackup.so Hi Ravindra, you are testing old 7.4 package based on 10.1.5 version. We do the comparison with 7.6 package open-vm-tools-10.2.5-3.el7 where we have full RELRO. Even if this wasn't the regression, it is still problem as our release tools block the package because of the partial RELRO so it can't be released. As we haven't been able to identify source of the change leading to loss of full RELRO hardening, we introduced downstream fix that manually add compile options to get full RELRO hardening for files reported as having partial RELRO. Miroslav, I just verified on RHEL 7.6 and you are right. It is a regression from RHEL 7.6 perspective. Do you have any patches for open-vm-tools? I don't think we changed anything in version 10.3.0 related to RELRO. I just built open-vm-tools-10.2.5-8068406 in RHEL 7.6 locally and results are very different from open-vm-tools 10.2.5 package from RHEL 7 repository: # ./configure --without-xerces --without-x --without-icu # make # ../checksec --file services/plugins/vmbackup/.libs/libvmbackup.so RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO No canary found NX enabled DSO RW-RPATH No RUNPATH 231 Symbols No 0 2 services/plugins/vmbackup/.libs/libvmbackup.so # ../checksec --file services/vmtoolsd/.libs/vmtoolsd RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO No canary found NX enabled No PIE RW-RPATH No RUNPATH 300 Symbols No 0 2 services/vmtoolsd/.libs/vmtoolsd So, I think it is something in RHEL 7.6 build environment that is enabling "Full RELRO". If you want to debug this, it might be worth comparing the RPM build logs for open-vm-tools 10.2.5 and 10.3.0 from RHEL 7.6. Hi Ravindra, problem with having partial RELRO is in open-vm-tools-10.3.0-8931395.tar.gz although we weren't able to identify the concrete change. 10.3.0 uses newer way of flag handling so it works correctly (have full RELRO) in RHEL 8 enviroment. However, RHEL 7 uses different approach not working with 10.3.0. As we weren't able to identify the problem we introduce downstream patch manually adding the flags: diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index 72dc4ff..82e2bc6 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -1526,7 +1526,7 @@ VMTOOLS_LIBS="$BUILDDIR/libvmtools/libvmtools.la $GLIB2_LIBS" VMTOOLS_CPPFLAGS="-DVMTOOLS_USE_GLIB $GLIB2_CPPFLAGS" PLUGIN_CPPFLAGS="$VMTOOLS_CPPFLAGS $PLUGIN_CPPFLAGS" -PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -Wl,--as-needed -shared -module -avoid-version" +PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -Wl,--as-needed -shared -module -avoid-version -Wl,-z,relro,-z,now" # Installation directories for core services plugins. TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests diff --git a/open-vm-tools/libDeployPkg/Makefile.am b/open-vm-tools/libDeployPkg/Makefile.am index b4d5c9d..f4e8f8b 100644 --- a/open-vm-tools/libDeployPkg/Makefile.am +++ b/open-vm-tools/libDeployPkg/Makefile.am @@ -39,7 +39,7 @@ libDeployPkg_la_SOURCES += linuxDeploymentUtilities.h libDeployPkg_la_LDFLAGS = # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD -libDeployPkg_la_LDFLAGS += -Wl,-lc +libDeployPkg_la_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now libDeployPkg_includedir = $(includedir)/libDeployPkg diff --git a/open-vm-tools/libguestlib/Makefile.am b/open-vm-tools/libguestlib/Makefile.am index 5181409..a21a3ff 100644 --- a/open-vm-tools/libguestlib/Makefile.am +++ b/open-vm-tools/libguestlib/Makefile.am @@ -32,7 +32,7 @@ libguestlib_la_SOURCES += vmGuestLib.c libguestlib_la_LDFLAGS = # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD -libguestlib_la_LDFLAGS += -Wl,-lc +libguestlib_la_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now libguestlib_includedir = $(includedir)/vmGuestLib diff --git a/open-vm-tools/libhgfs/Makefile.am b/open-vm-tools/libhgfs/Makefile.am index 7609145..50573ee 100644 --- a/open-vm-tools/libhgfs/Makefile.am +++ b/open-vm-tools/libhgfs/Makefile.am @@ -41,5 +41,5 @@ libhgfs_la_LDFLAGS = libhgfs_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libhgfs_la_LDFLAGS += -Wl,-lc +libhgfs_la_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now diff --git a/open-vm-tools/libvmtools/Makefile.am b/open-vm-tools/libvmtools/Makefile.am index 1971942..6a4ca74 100644 --- a/open-vm-tools/libvmtools/Makefile.am +++ b/open-vm-tools/libvmtools/Makefile.am @@ -91,5 +91,5 @@ libvmtools_la_LDFLAGS = libvmtools_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libvmtools_la_LDFLAGS += -Wl,-lc +libvmtools_la_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now diff --git a/open-vm-tools/vgauth/lib/Makefile.am b/open-vm-tools/vgauth/lib/Makefile.am index bce97aa..6c0c265 100644 --- a/open-vm-tools/vgauth/lib/Makefile.am +++ b/open-vm-tools/vgauth/lib/Makefile.am @@ -59,7 +59,7 @@ libvgauth_la_LDFLAGS = libvgauth_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libvgauth_la_LDFLAGS += -Wl,-lc +libvgauth_la_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now # Message catalogs. install-data-hook: Fix included in open-vm-tools-10.3.0-2.el7 WW16.1 UPDATE:
Verified this BZ in RHEL7.7 with open-vm-tools-10.3.0-2.el7, couldn't meet it.
ENV:
Host: VMware ESXi, 6.7.0, 10764712
Guest: RHEL7.6
OVT: open-vm-tools-10.3.0-2.el7.x86_64
Steps to Reproduce:
0. Confirm RHEL7.6 OVT version
1. Tool checksec to check target files marked in description
2. Check their results
Results:
1. After step 2, list all targets files info
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
[root@vm-198-150 ~]# ./checksec.sh --dir /usr/lib64/open-vm-tools/plugins/vmsvc/
RELRO STACK CANARY NX PIE RPATH RUNPATH FILE
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/vmsvc/libdeployPkgPlugin.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/vmsvc/libgrabbitmqProxy.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/vmsvc/libguestInfo.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/vmsvc/libpowerOps.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/vmsvc/libresolutionKMS.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/vmsvc/libtimeSync.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/vmsvc/libvmbackup.so
[root@vm-198-150 ~]# ./checksec.sh --dir /usr/lib64/open-vm-tools/plugins/common/
RELRO STACK CANARY NX PIE RPATH RUNPATH FILE
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/common/libhgfsServer.so
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/open-vm-tools/plugins/common/libvix.so
[root@vm-198-150 ~]# ./checksec.sh --file /usr/lib64/libvmtools.so.0.0.0
RELRO STACK CANARY NX PIE RPATH RUNPATH FILE
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/libvmtools.so.0.0.0
[root@vm-198-150 ~]# ./checksec.sh --file /usr/lib64/libvgauth.so.0.0.0
RELRO STACK CANARY NX PIE RPATH RUNPATH FILE
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/libvgauth.so.0.0.0
[root@vm-198-150 ~]# ./checksec.sh --file /usr/lib64/libhgfs.so.0.0.0
RELRO STACK CANARY NX PIE RPATH RUNPATH FILE
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/libhgfs.so.0.0.0
[root@vm-198-150 ~]# ./checksec.sh --file /usr/lib64/libguestlib.so.0.0.0
RELRO STACK CANARY NX PIE RPATH RUNPATH FILE
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/libguestlib.so.0.0.0
[root@vm-198-150 ~]# ./checksec.sh --file /usr/lib64/libDeployPkg.so.0.0.0
RELRO STACK CANARY NX PIE RPATH RUNPATH FILE
Full RELRO Canary found NX enabled DSO No RPATH No RUNPATH /usr/lib64/libDeployPkg.so.0.0.0
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
Set the Status as "VERIFIED", if you have any question, please re-set it.
@Miroslav
Any others targets files need to be checked?
BR,
BO
Thanks, no other files to check. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:2139 |