Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 386721

Summary: app-emulation/open-vm-tools-kmod-0.0.20110821.471295 fails to build against hardened-sources-3.0.4-r1
Product: Gentoo Linux Reporter: Martin Kolleck <martin.kolleck>
Component: [OLD] UnspecifiedAssignee: Gentoo VMWare Bug Squashers [disabled] <vmware+disabled>
Status: RESOLVED OBSOLETE    
Severity: major CC: frank_limpert, hardened, ndrwdn, pageexec, penguin, RusBaratov, tom
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Build log.
Output of `emerge --info`.
vmci driver.c patch
Ebuild to apply vmci-driver.patch
Script to place in /etc/portage/postsync.d

Description Martin Kolleck 2011-10-11 07:10:57 UTC
open-vm-tools-kmod fails to build since the stabilization of hardened-sources-3.0.4-r1. The problem has also been reported on the forum http://forums.gentoo.org/viewtopic-p-6837656.html

Reproducible: Always

Steps to Reproduce:
1. Have a hardened profile.
2. Update to the latest stable kernel version (currently 3.0.4-r1)
3. Try to emerge open-vm-tools-kmod.

Actual Results:  
Build fails with the following error (occurs several times)

/var/tmp/portage/app-emulation/open-vm-tools-kmod-0.0.20110821.471295/work/open-vm-tools-2011.08.21-471295/modules/linux/vmci/linux/driver.c:388:4: error: assignment of read-only variable ‘vmuser_fops’

See attached build log.
Comment 1 Martin Kolleck 2011-10-11 07:16:23 UTC
Created attachment 289513 [details]
Build log.
Comment 2 Martin Kolleck 2011-10-11 07:16:50 UTC
Created attachment 289515 [details]
Output of `emerge --info`.
Comment 3 Arnim Eijkhoudt 2011-10-11 20:39:54 UTC
I'm experiencing the same problem (author of the post on the forums).
Comment 4 Tom Hendrikx 2011-10-12 11:38:20 UTC
I can also confirm this happens.
Comment 5 Frank Limpert 2011-10-13 10:34:27 UTC
This appens here too on x86 and amd64. I even tried open-vm-tools-kmod-0.0.20110923.491607 that gave the same errors.
Comment 6 Andrew Dean 2011-10-13 20:46:08 UTC
Created attachment 289757 [details, diff]
vmci driver.c patch

Does static initialization of vmuser_fops structure.
Comment 7 Andrew Dean 2011-10-13 20:46:47 UTC
Created attachment 289759 [details]
Ebuild to apply vmci-driver.patch
Comment 8 Andrew Dean 2011-10-13 20:48:21 UTC
The patch and ebuild I just attached allows open-vm-tools-kmod to compile on my hardened x64 VM.  Of course, this needs better testing, so use at your own risk.
Comment 9 Frank Limpert 2011-10-25 15:02:21 UTC
Your patch and ebuild works for me with open-vm-tools-kmod-0.0.20110923.491607 on x86 and amd64. Please commit these to the portage tree.
Comment 10 Arnim Eijkhoudt 2011-11-05 22:13:00 UTC
Can someone please get the fixes upstream? This bug report is still listed as UNCONFIRMED as well for some reason?
Comment 11 Martin Kolleck 2011-11-08 15:39:58 UTC
Works for me as well. For now I embedded the patch and ebuild into a script that is placed in /etc/portage/postsync.d.

As for UNCONFIRMED: I cannot change the status to anything besides RESOLVED, which it isn't.
Comment 12 Arnim Eijkhoudt 2011-12-08 17:14:48 UTC
This issue is still open, listed as unconfirmed and still exists right up to the latest version of open-vm-tools-kmod. Is there anything we/I can do to get this merged into the tree?

@Martin Kolleck: is there any chance you could post the postsync.d script for me?
Comment 13 Martin Kolleck 2011-12-08 21:26:12 UTC
Created attachment 295221 [details]
Script to place in /etc/portage/postsync.d

Don't forget to make the script executable.

When syncing the portage tree, the patch file and the ebuild that applies the patch are removed. With this script in place, these files are recreated.

The script is far from perfect. It uses 'patch' instead of 'cat' because I created it from a diff on the tree. Also, you'll need to update the version number in the script every time there's a new ebuild in the tree.
Comment 14 Faustus 2011-12-13 10:31:46 UTC
On x86 (not amd64) hardened-sources-3.0.4-r5, I'm getting:

Using 2.6.x kernel build system.
make: *** No rule to make target `auto-build'.  Stop.
Comment 15 Martin Kolleck 2011-12-13 12:10:39 UTC
Faustus: Sorry, I cannot reproduce this error. I just tried to install open-vm-tool-kmod-2011.11.20.535097 with the above patches in place in a mostly stable x86 hardened environment. It worked like a charm.
Comment 16 Kai Krakow 2011-12-14 16:39:46 UTC
I can still reproduce this on hardened amd64 with hardened-sources-3.0.4-r5 and app-emulation/open-vm-tools-kmod-2011.11.20.535097...

So this is still an issue in newer versions of the package.
Comment 17 Faustus 2011-12-19 15:33:11 UTC
(In reply to comment #15)
> Faustus: Sorry, I cannot reproduce this error. I just tried to install
> open-vm-tool-kmod-2011.11.20.535097 with the above patches in place in a mostly
> stable x86 hardened environment. It worked like a charm.

Indeed, it was a problem on my side - had a VERSION environment variable set. Good old bug #56407 strikes again...
Comment 18 Tom Hendrikx 2012-02-03 20:39:07 UTC
There are currently 2 hardened-sources ebuilds available that are no longer vulnerable w.r.t. CVE-2012-0056 (2.6.32-r89 and 3.2.2-r1), but all current in-tree ebuilds for open-vm-tools-kmod (0.0.20111026.514583, 2011.11.20.535097, 8.8.1.528969) fail to build against them. This means there's no safe upgrade path for users who are waiting for this bug to be resolved.

I also noticed that the ‘vmuser_fops’ error in vmci driver also happens when trying to compile the offical vmware modules from app-emulation/vmware-tools-8.8.1.528992 (against hardened-sources-3.2.2-r1).

Finally, this bug was cross-reported on open-vm-tools bugtracker [1] almost 2 months ago without seeing any followup. Maybe we shouldn't be waiting for an upstream fix (are we?) but just fix the ebuilds in portage? Maintainer?

[1] http://sourceforge.net/tracker/?func=detail&aid=3454768&group_id=204462&atid=989708
Comment 19 PaX Team 2012-02-04 12:06:40 UTC
open-vm-tools-kmod-2011.12.20.562307 compiles with 3.2.4/PaX and for vmware-modules-238 i've had a patch in my homedir since last september.
Comment 20 Richard Yao (RETIRED) gentoo-dev 2012-10-22 10:50:59 UTC
hardened-sources-3.0* is no longer in the tree. Closing obsolete.